Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Description endpoint Bragi (geocoder, autocomplete...)

Sebastien edited this page Nov 24, 2021 · 2 revisions

Autocomplete

GET  https://www.qwant.com/maps/geocoder/autocomplete

Query parameters:

  • q : query

  • lang :  lang to use in the query and to format results (optional, only local geographical names will be used by default). Accepted values:  en,fr,de,it,es,br,ca

  • limit : maximum number of results (default: 10)

  • type[] : types of elements to return. Multiple values may be passed. Accepted values:  poi,house,street,zone For example to return both exact addresses (with house number) and streets:  ?type[]=house&type[]=street

  • zone_type[] : types of zones to return (applicable only with type[]=zone) Multiple values may be passed. Accepted values:  country, country_region, state, state_district, city, city_district, suburb, non_administrative

Response:

https://www.qwant.plive/maps/geocoder/autocomplete?q=8%20rue%20de%20rivoli&lang=fr&type[]=house&type[]=street&limit=2

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "coordinates": [    // lon,lat (x,y)
          2.360896,
          48.855365
        ],
        "type": "Point"
      },
      "properties": {
        "geocoding": {
          "id": "addr:2.360896;48.855365:8",
          "type": "house",
          "label": "8 Rue de Rivoli (Paris)",  
          "name": "8 Rue de Rivoli",
          "housenumber": "8",
          "street": "Rue de Rivoli",
          "postcode": "75004",
          "city": "Paris",
          "administrative_regions": [ // details about the administrative zones where the result is located
            {
              "id": "admin:osm:relation:2172741",
              "label": "Quartier Saint-Gervais (75004), Paris 4e Arrondissement, Paris, Île-de-France, France",
              "name": "Quartier Saint-Gervais",
              "zip_codes": [
                "75004"
              ],
              "coord": {
                "lon": 2.3583227556805944,
                "lat": 48.855857561176315
              },
              "bbox": [
                2.3527386,
                48.8510686,
                2.3642877,
                48.8600747
              ],
              "zone_type": "suburb",
              "parent_id": "admin:osm:relation:9597",
              "codes": [
                {
                  "name": "ref:INSEE",
                  "value": "7510414"
                },
                {
                  "name": "wikidata",
                  "value": "Q3413113"
                }
              ]
            },
            {
              "id": "admin:osm:relation:7444",
              "label": "Paris (75000-75116), Île-de-France, France",
              "name": "Paris",
              "zip_codes": [
                "75000",
                "75001",
                "75002",
                "75003",
                "75004",
                "75005",
                "75006",
                "75007",
                "75008",
                "75009",
                "75010",
                "75011",
                "75012",
                "75013",
                "75014",
                "75015",
                "75016",
                "75017",
                "75018",
                "75019",
                "75020",
                "75116"
              ],
              "coord": {
                "lon": 2.3514616,
                "lat": 48.8566969
              },
              "bbox": [
                2.224122,
                48.8155755,
                2.4697602,
                48.902156
              ],
              "zone_type": "city",
              "parent_id": "admin:osm:relation:71525",
              "codes": [
                {
                  "name": "ref:FR:MGP",
                  "value": "T1"
                },
                {
                  "name": "ref:INSEE",
                  "value": "75056"
                },
                {
                  "name": "wikidata",
                  "value": "Q90"
                }
              ]
            },
            {
              "id": "admin:osm:relation:71525",
              "label": "Paris, Île-de-France, France",
              "name": "Paris",
              "zip_codes": [],
              "coord": {
                "lon": 2.3514616,
                "lat": 48.8566969
              },
              "bbox": [
                2.224122,
                48.8155755,
                2.4697602,
                48.902156
              ],
              "zone_type": "state_district",
              "parent_id": "admin:osm:relation:8649",
              "codes": [
                {
                  "name": "ISO3166-2",
                  "value": "FR-75"
                },
                {
                  "name": "ref:INSEE",
                  "value": "75"
                },
                {
                  "name": "ref:NUTS",
                  "value": "FR101"
                }
              ]
            },
            {
              "id": "admin:osm:relation:8649",
              "label": "Île-de-France, France",
              "name": "Île-de-France",
              "zip_codes": [],
              "coord": {
                "lon": 2.3514616,
                "lat": 48.8566969
              },
              "bbox": [
                1.4462445,
                48.1201456,
                3.5592208,
                49.241431
              ],
              "zone_type": "state",
              "parent_id": "admin:osm:relation:2202162",
              "codes": [
                {
                  "name": "ISO3166-2",
                  "value": "FR-IDF"
                },
                {
                  "name": "ref:INSEE",
                  "value": "11"
                },
                {
                  "name": "ref:NUTS",
                  "value": "FR10"
                },
                {
                  "name": "wikidata",
                  "value": "Q13917"
                }
              ]
            },
            {
              "id": "admin:osm:relation:2202162",
              "label": "France",
              "name": "France",
              "zip_codes": [],
              "coord": {
                "lon": 2.3514616,
                "lat": 48.8566969
              },
              "bbox": [
                -178.3873749,
                -50.2187169,
                172.30571519999998,
                51.268318
              ],
              "zone_type": "country",
              "parent_id": null,
              "codes": [
                {
                  "name": "ISO3166-1",
                  "value": "FR"
                },
                {
                  "name": "ISO3166-1:alpha2",
                  "value": "FR"
                },
                {
                  "name": "ISO3166-1:alpha3",
                  "value": "FRA"
                },
                {
                  "name": "ISO3166-1:numeric",
                  "value": "250"
                },
                {
                  "name": "wikidata",
                  "value": "Q142"
                }
              ]
            },
            {
              "id": "admin:osm:relation:9597",
              "label": "Paris 4e Arrondissement (75004), Paris, Île-de-France, France",
              "name": "Paris 4e Arrondissement",
              "zip_codes": [
                "75004"
              ],
              "coord": {
                "lon": 2.3556193,
                "lat": 48.8562021
              },
              "bbox": [
                2.3445787,
                48.8461402,
                2.3691373,
                48.8619928
              ],
              "zone_type": "city_district",
              "parent_id": "admin:osm:relation:7444",
              "codes": [
                {
                  "name": "ref:INSEE",
                  "value": "75104"
                },
                {
                  "name": "wikidata",
                  "value": "Q230127"
                }
              ]
            }
          ]
        }
      }
    },
    {
      "type": "Feature",
      "geometry": {
        "coordinates": [
          0.693997,
          47.374727
        ],
        "type": "Point"
      },
      "properties": {
        "geocoding": {
          "id": "addr:0.693997;47.374727:8",
          "type": "house",
          "label": "8 Rue de Rivoli (Tours)",
          "name": "8 Rue de Rivoli",
          "housenumber": "8",
          "street": "Rue de Rivoli",
          "postcode": "37000",
          "city": "Tours",
          "administrative_regions": [
            {
              "id": "admin:osm:relation:7408",
              "label": "Indre-et-Loire, Centre-Val de Loire, France",
              "name": "Indre-et-Loire",
              "zip_codes": [],
              "coord": {
                "lon": 0.6889268,
                "lat": 47.3900474
              },
              "bbox": [
                0.052720899999999994,
                46.736661,
                1.3659439,
                47.7097889
              ],
              "zone_type": "state_district",
              "parent_id": "admin:osm:relation:8640",
              "codes": [
                {
                  "name": "ISO3166-2",
                  "value": "FR-37"
                },
                {
                  "name": "ref:INSEE",
                  "value": "37"
                },
                {
                  "name": "ref:NUTS",
                  "value": "FR244"
                },
                {
                  "name": "wikidata",
                  "value": "Q12556"
                }
              ]
            },
            {
              "id": "admin:osm:relation:8640",
              "label": "Centre-Val de Loire, France",
              "name": "Centre-Val de Loire",
              "zip_codes": [],
              "coord": {
                "lon": 1.9086066,
                "lat": 47.9027336
              },
              "bbox": [
                0.052720899999999994,
                46.3471572,
                3.1286392,
                48.9410263
              ],
              "zone_type": "state",
              "parent_id": "admin:osm:relation:2202162",
              "codes": [
                {
                  "name": "ISO3166-2",
                  "value": "FR-CVL"
                },
                {
                  "name": "ref:INSEE",
                  "value": "24"
                },
                {
                  "name": "ref:NUTS",
                  "value": "FR24"
                },
                {
                  "name": "wikidata",
                  "value": "Q13947"
                }
              ]
            },
            {
              "id": "admin:osm:relation:2202162",
              "label": "France",
              "name": "France",
              "zip_codes": [],
              "coord": {
                "lon": 2.3514616,
                "lat": 48.8566969
              },
              "bbox": [
                -178.3873749,
                -50.2187169,
                172.30571519999998,
                51.268318
              ],
              "zone_type": "country",
              "parent_id": null,
              "codes": [
                {
                  "name": "ISO3166-1",
                  "value": "FR"
                },
                {
                  "name": "ISO3166-1:alpha2",
                  "value": "FR"
                },
                {
                  "name": "ISO3166-1:alpha3",
                  "value": "FRA"
                },
                {
                  "name": "ISO3166-1:numeric",
                  "value": "250"
                },
                {
                  "name": "wikidata",
                  "value": "Q142"
                }
              ]
            },
            {
              "id": "admin:osm:relation:76306",
              "label": "Tours (37000-37200), Indre-et-Loire, Centre-Val de Loire, France",
              "name": "Tours",
              "zip_codes": [
                "37000",
                "37100",
                "37200"
              ],
              "coord": {
                "lon": 0.6889268,
                "lat": 47.3900474
              },
              "bbox": [
                0.6528317,
                47.3489171,
                0.7373427,
                47.4395937
              ],
              "zone_type": "city",
              "parent_id": "admin:osm:relation:7408",
              "codes": [
                {
                  "name": "ref:INSEE",
                  "value": "37261"
                },
                {
                  "name": "wikidata",
                  "value": "Q288"
                }
              ]
            }
          ]
        }
      }
    }
  ]
}