'Successful API call but no data returned
I'm trying to request data from api.travelpayouts to find cheap flights, but even after trying exact examples from their documentation I'm not returning any data.
The code I'm using (with example fields from the website* and my authorisation keys) is:
import requests
url = "https://api.travelpayouts.com/v1/prices/cheap"
querystring = {"origin":"MOW","destination":"HKT","depart_date":"2019-11","return_date": "2019-12"}
headers = {'x-access-token': 'xxxx'}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.json())
According to the example, the return should be:
{
"success": true,
"data": {
"HKT": {
"0": {
"price": 35443,
"airline": "UN",
"flight_number": 571,
"departure_at": "2015-06-09T21:20:00Z",
"return_at": "2015-07-15T12:40:00Z",
"expires_at": "2015-01-08T18:30:40Z"
}}
}
}
but I receive:
{'success': True, 'data': {}, 'currency': 'rub'}
If anyone could give me some tips I would greatly appreciate it! Thanks.
Solution 1:[1]
I tried in insomnia app and no data pictures
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
