I’m new to using API’s so I am trying to do a simple API call to plan a journey can anyone explain why I keep getting error code 500 and how to fix it?
if response.status_code == 200:
# Process the response data
data = response.json()
print(data) # Example: Print the data
else:
print(“Error:”, response.status_code)
(My API key is stored in the variable and I have already imported requests)
When reading API documentation, please note that {braces} denote required parameters and [square brackets] denote optional parameters. You should not actually include those bracket symbols in your request URL, and you should omit any optional parameters you aren’t using.