Examples requests
Detailed and explained requests
Example Requests
Here are two examples of how to use the t
parameter with locality enclosed in square brackets, explained step by step.
Example 1: Searching for an Address with a Locality
Scenario:
You want to search for “Calle de Barcelona 16” in the locality “Madrid”. Using brackets ensures the locality is properly recognized.
Request
https://lb.cercalia.com/suggest/SuggestServlet?key=your_api_key&t=Calle de Barcelona 16, [Madrid]
Explanation
t
:Calle de Barcelona 16 [Madrid]
- The street name is “Calle de Barcelona 16”.
- The locality is specified as Madrid, enclosed in square brackets
[Madrid]
.
- The brackets ensure that the locality is matched, and anything after
[Madrid]
is ignored.
Example 2: Searching for an Address with a Postal Code and Locality
Scenario:
You want to search for “Calle de Barcelona 16, 28012” in the locality Madrid, while including the postal code.
Request
https://lb.cercalia.com/suggest/SuggestServlet?key=your_api_key&t=Calle de Barcelona 16, Madrid
Explanation
t
:Calle de Barcelona 16, 28012 [Madrid]
- The street name is “Calle de Barcelona 16”.
- The postal code is 28012, and it’s included in the text.
- The locality is Madrid, enclosed in square brackets
[Madrid]
.
Notes:
- Replace
your_api_key
with the actual API key provided by Cercalia.
This format breaks down each request into an easily digestible explanation, making it clear what each parameter does and how it works.