/geocoding

Translates human readable addresses into locations on the map (latitude, longitude).

↗ Open in API Explorer
GET

Geocoding

Translates human-readable addresses into locations on the map (latitude, longitude).

Request

Endpoint: GET https://api.outscraper.cloud/geocoding

Parameters

NameInTypeRequiredDescriptionExampleConstraints
query query array<string> Yes Addresses specifying the location for which you want to get the coordinates (e.g., 321 California Ave, Palo Alto, CA 94306, Central Park, NY). It supports batching by sending arrays with up to 1000 queries (e.g., query=text1&query=text2&query=text3). It allows multiple queries to be sent in one request and to save on network latency time. - -

Responses

200

application/json

The response contains the status of the request and data. Data is an array where each element represents a response for a single query from the request.

{
  "id": "your-request-id",
  "status": "Success",
  "data": [
    {
      "query": "321 California Ave, Palo Alto, CA 94306",
      "latitude": 37.4270502,
      "longitude": -122.14384609999999,
      "country": "United States of America",
      "state": "California",
      "city": "Palo Alto",
      "borough": "Evergreen Park",
      "street": "321 California Ave",
      "postal_code": "94306",
      "time_zone": "America/Los_Angeles",
      "street_view": "https://streetviewpixels-pa.googleapis.com/v1/thumbnail?panoid=DToAt0TizIuNUSxC5MZkXQ&cb_client=search.gws-prod.gps&w=1600&h=1000&yaw=150.42152&pitch=0&thumbfov=100"
    }
  ]
}

202

application/json

The response contains a request ID that can be used to fetch results by using Request Results endpoint. Each response is available for 4 hours after a request has been completed.

{
  "id": "your-request-id",
  "status": "Pending",
  "results_location": "https://api.outscraper.cloud/requests/your-request-id"
}

401

application/json

Wrong or missing API Key (token).

{
  "error": true,
  "errorMessage": "401 Unauthorized: The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required."
}

402

application/json

Past due invoices or a payment method not connected.

{
  "error": true,
  "errorMessage": "Please close past due invoices or verify your card information is correct."
}

422

application/json

Wrong query url parameters.

{
  "error": true,
  "errorMessage": "422 Unprocessable Entity: The request was well-formed but was unable to be followed due to semantic errors."
}

Code Samples

cURL

curl -X GET "https://api.outscraper.cloud/geocoding?query=321%20California%20Ave%2C%20Palo%20Alto%2C%20CA%2094306" -H  "X-API-KEY: YOUR-API-KEY"

Related Endpoints