Last active
August 26, 2023 17:14
-
-
Save thanos/94a76e15f3b2dff87a513e57545b3ac0 to your computer and use it in GitHub Desktop.
Gets a list of locations, based on a search thing, from the Xeni travel api
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# an alternative to "python -m json.tool" is "json_pp -json_opt pretty,canonical" | |
curl -X 'GET' \ | |
"$XENI_API_HOST/api/locations/search?starts_with=New%20York" \ | |
-H "accept: application/json" \ | |
-H "authorization: bearer: $XENI_TOKEN" \ | |
| python -m json.tool | |
{ | |
"data": [ | |
{ | |
"id": "bbc35c49-d2a7-431a-ac40-a4944c3a00e7", | |
"name": "New York, New York, United States of America", | |
"type": "city" | |
}, | |
{ | |
"id": "fda1a5e6-bf14-4caa-99b4-6d896650a047", | |
"name": "New York, NY (JRA-West 30th Street Heliport), New York, New York, United States of America", | |
"type": "airport" | |
}, | |
{ | |
"id": "6b24a5dc-9fde-4770-ac55-ecc86882478a", | |
"name": "New York, NY (JRE-East 60th Street Heliport), New York, New York, United States of America", | |
"type": "airport" | |
}, | |
{ | |
"id": "e35fc3ba-c39a-413d-8a92-ff53e3d9ab63", | |
"name": "New York, NY (TSS-East 34th Street Heliport), New York, New York, United States of America", | |
"type": "airport" | |
} | |
] | |
} | |
Author
thanos
commented
Jul 23, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment