Skip to main content

Places - Creation using Google

warning

You must have your TRIP API Key and your account should have a Google API Key set to continue.

You can create a place resolved by Google using the URL /api/by_token/google-search and the method POST.
Your TRIP API Key must be set in the headers: X-Api-Token: <key>.

You have three resolve options:

  1. By name (e.g. British Museum)
  2. By Place link (e.g. https://www.google.com/maps/place/British+Museum/@51.5194166,-0.1295...0vMDFoYjM)
  3. By Short link (e.g. https://maps.app.goo.gl/6smTQYq2CmHB5pMN7)
format

The body of your request is always the same:

{
"q": "..."
}

Optionally, you can specify a Category. If GMaps types mapping to category is not working and no category is provided, the place will not be created.

{
"q": "...",
"category": "Culture"
}

By Name

Method: POST.
URL: /api/by_token/google-search.
Headers: X-Api-Token: <key>.

{
"q": "British Museum",
"category": "Culture"
}

Method: POST.
URL: /api/by_token/google-search.
Headers: X-Api-Token: <key>.

{
"q": "https://www.google.com/maps/place/British+Museum/@51.5194166,-0.1295315,17z/data=!3m1!4b1!4m6!3m5!1s0x48761b323093d307:0x2fb199016d5642a7!8m2!3d51.5194133!4d-0.1269566!16zL20vMDFoYjM",
"category": "Culture"
}

Method: POST.
URL: /api/by_token/google-search.
Headers: X-Api-Token: <key>.

{
"q": "https://maps.app.goo.gl/6smTQYq2CmHB5pMN7",
"category": "Culture"
}