Skip to content

Instantly share code, notes, and snippets.

@thanos
Last active August 26, 2023 17:14
Show Gist options
  • Save thanos/94a76e15f3b2dff87a513e57545b3ac0 to your computer and use it in GitHub Desktop.
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
# 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"
}
]
}
@thanos
Copy link
Author

thanos commented Jul 23, 2023

Screenshot 2023-07-22 at 21 31 29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment