How to get coordinates from city, state and country with HTTP request

Hello

I’m trying to find the coordinate of a specific city. Let get the city Roquefort base in France, the result will be for 10 city having the same name.
But I want to a specific one from a specific state.

Let say I want “municipality”: “Roquefort” form “countrySecondarySubdivision”: “Lot-et-Garonne” from “countryCode”: “FR”
How do I do this ?

There is my http request tries without success:

https://api.tomtom.com/search/2/search/roquefort,lot-et-garonne.json?key=xxxxxxxxxxxx&limit=1&language=en-US&entityTypeSet=Municipality&countrySet=fr

https://api.tomtom.com/search/2/search/roquefort.json?key=xxxxxxxxxxxx&limit=1&language=en-US&entityTypeSet=Municipality&countrySet=fr&countrySecondarySubdivision=lot-et-garonne

none of this 2 tries works

Someone have the correct syntax ?

Thanks for your help :slight_smile:

1 Like

I think I found out:

I did like this
https://api.tomtom.com/search/2/search/lot-et-garonne,roquefort.json?key=xxxxxxxxxxxxx&limit=1&language=en-US&entityTypeSet=CountrySecondarySubdivision,Municipality&countrySet=fr

Can someone tell me if it’s correct ?

Thanks a lot :slight_smile:

Those first two are also returning the response.

2 Likes