99e0701a73aa

latestOpenAPI 3.1.02026-08-0420183200.9 KB
Geocoding

Quickly run a batch of geocoding queries against the search, structured search, or reverse endpoints.

The batch endpoint lets you specify many search, structured search, or reverse requests at once. Once received, all requests will be processed internally on our infrastructure, improving throughput when you need to do a lot of queries.

post/geocoding/v1/search/bulk

Request body

endpoint'/v1/search' | '/v1/search/structured' | '/v1/reverse' required

Example request

[
  {
    "endpoint": "/v1/search",
    "query": {
      "text": "Põhja pst 27"
    }
  },
  {
    "endpoint": "/v1/search",
    "query": {
      "lang": "en",
      "text": "101 N Main St, Greenville SC"
    }
  },
  {
    "endpoint": "/v1/reverse",
    "query": {
      "lang": "en",
      "point.lat": 48.848268,
      "point.lon": 2.294471
    }
  }
]

Response

A JSON array of the individual query responses, each annotated with a status code. Individual requests may fail but this endpoint will still return all results. Responses will be in the same order as the input.

statusinteger required
msgstring

An error message describing what went wrong (if the status is not 200).

Example response

[
  {
    "response": {
      "bbox": [
        -77.036547,
        38.897675,
        -77.036547,
        38.897675
      ],
      "features": [
        {
          "geometry": {
            "coordinates": [
              -77.036547,
              38.897675
            ],
            "type": "Point"
          },
          "properties": {
            "accuracy": "point",
            "confidence": 1,
            "continent": "North America",
            "continent_gid": "whosonfirst:continent:102191575",
            "country": "United States",
            "country_a": "USA",
            "country_code": "US",
            "country_gid": "whosonfirst:country:85633793",
            "county": "District of Columbia",
            "county_a": "DI",
            "county_gid": "whosonfirst:county:1377370667",
            "gid": "openaddresses:address:us/dc/statewide:aa53d4bd0fe295be",
            "housenumber": "1600",
            "id": "us/dc/statewide:aa53d4bd0fe295be",
            "label": "1600 Pennsylvania Avenue NW, Washington, DC, USA",
            "layer": "address",
            "locality": "Washington",
            "locality_gid": "whosonfirst:locality:85931779",
            "match_type": "exact",
            "name": "1600 Pennsylvania Avenue NW",
            "neighbourhood": "White House Grounds",
            "neighbourhood_gid": "whosonfirst:neighbourhood:1108724059",
            "postalcode": "20500",
            "region": "District of Columbia",
            "region_a": "DC",
            "region_gid": "whosonfirst:region:85688741",
            "source": "openaddresses",
            "source_id": "us/dc/statewide:aa53d4bd0fe295be",
            "street": "Pennsylvania Avenue NW"
          },
          "type": "Feature"
        }
      ],
      "geocoding": {
        "attribution": "https://stadiamaps.com/attribution",
        "engine": {
          "name": "Theseus",
          "version": "1.0"
        },
        "query": {
          "lang": {
            "defaulted": true,
            "iso6391": "en",
            "iso6393": "eng",
            "name": "English",
            "via": "default"
          },
          "parsed_text": {
            "housenumber": "1600",
            "street": "pennsylvania ave nw"
          },
          "parser": "libpostal",
          "private": false,
          "querySize": 20,
          "size": 10,
          "text": "1600 Pennsylvania Ave NW"
        },
        "timestamp": 1679043782383,
        "version": "0.2"
      },
      "type": "FeatureCollection"
    }
  }
]