Geographical search engine API
Resource Information
- URL
- https://b5m.gipuzkoa.eus/api/2.0/toposearch2
- Response Formats
- JSON, XML
- Authentication
- No
- Limited ratio
- Yes
Using this API you can search for the toponymy and addresses of Gipuzkoa. The b5m geo search uses this API in search engines and geographical directories.
Request parameters
| Parameter | Description | Default | Required |
|---|---|---|---|
| q | Geographic name (toponymic) or the address to be searched. Names of municipalities, street names, toponymic names (mountains, streams, rivers, places ...), etc. are allowed. | - | No |
| lang | Language. Three are available: eu, es and en. Default, eu. | eu | No |
| start | Number of responses to skip. | 0 | No |
| rows | Number of search responses, after the start parameter. | 1000000 | No |
| city | Name or municipality code. | - | No |
| street | Name or street code (you must also put the parameter city). | - | No |
| riverbasin | River basin name. It will find the hydrographic features of the basin. | - | No |
| road | Name of the road. Search for the road. | - | No |
| addr | Only addresses (addr = 1). It is equivalent to type = postal_address. | 0 | No |
| viewbox | To narrow the search in a geographic window. Parameter format: [minimum_longitude,minimum_latitude,maximum_longitude,maximum_latitude], coordinate system EPSG:4326. | - | No |
| pt | If we use the geographic window, we have the possibility of splitting the search by a central point. By this way, the result will be ordered by distance to that centre. Format of the parameters: [longitude,latitude], in the coordinate system EPSG: 4326. | - | No |
| dist | Search distance in kilometres from the point of the parameter pt. | 80 | No |
| b5m_id | Search by b5m code. | - | No |
| sort | In free search (parameter q ) order of results by name by search similarity. Options: [asc|desc]. | asc | No |
| nor | Normalized classification of the result, in percentage. Options: [0|1]. | 0 | No |
| numfound | Just the number of search results. Options: [0|1]. | 0 | No |
| types | Just the list of item types to search for. Options: [0|1]. | 0 | No |
| type | The search will be done on the type of element specified. That type must be one of those contained in the list of the types parameter. | 0 | No |
| format | Format of the response. It should be: json, xml or php. | json | No |
Examples
- 1. Simple search
-
https://b5m.gipuzkoa.eus/api/2.0/toposearch2?q=txindoki&lang=en
- 2. Simple search but within a geographic window (viewbox) and from a geographic point (pt)
-
https://b5m.gipuzkoa.eus/api/2.0/toposearch2?q=txindoki&viewbox=-2.02,43.30,-1.97,43.32&pt=-2.00,43.31&lang=en
- 3. Simple search, within a geographic window (viewbox), starting from a geographic point (pt) and specifying the search distance (dist)
-
https://b5m.gipuzkoa.eus/api/2.0/toposearch2?q=txindoki&viewbox=-2.02,43.30,-1.97,43.32&pt=-2.00,43.31&dist=10&lang=en
- 4. Search for an address
-
https://b5m.gipuzkoa.eus/api/2.0/toposearch2?q=claudio anton luzuriaga 3&lang=en
- 5. Search for a road
-
https://b5m.gipuzkoa.eus/api/2.0/toposearch2?q=gi-2131&lang=en
- 6. Search for the kilometre point of a road
-
https://b5m.gipuzkoa.eus/api/2.0/toposearch2?q=gi-2131 2&lang=en
Response
| Field | Description |
|---|---|
| boundingbox | Minimum bounding box (Minimum Bounding Box) for a geographical set. |
| postcode | Zip code (in case of an address). |
| door_number | Portal number (in case of an address). |
| distance | Distance of the element to the centre of the search (parameter pt). |
| importance | Importance of the item in the search result. It is a number, and the higher it is, the more important the item will be. |
| b5m_id | B5m code of the geographic element |
| GFA_code1 | Code 1 PCG of the geographic element. |
| GFA_code2 | Code 2 PCG of the geographic element. |
| GFA_id | Identifier PCG of the geographic element. |
| GFA_idcarre | Identifier PCG of the geographical element (if it is a road). |
| display_name | Name of the geographic element in the language the request was made (lang). |
| type | Type of geographic feature. |
| road | Name of the road if it is a Kilometric Point (KP). |
| KP | KP of the road. |
| way | KP's way inside the road. |
| description | Description of the geographic element (if it is a road). |
| city | Name of the municipality. |
| street | Name of the street. |
| lon | Longitude of the centre of the geographic element. |
| lat | Latitude of the centre of the geographic element. |
| map_link | URL to see the geographic element on the b5m map. |