Skip to content
OpenGeocodeOpenGeocodeOpenGeocodeDownloads

Geocodes every row of a CSV or JSONL upload. Rows are looked up while the file uploads, and their results stream back in this response: CSV in the order rows were sent, JSONL in the order they finish, each line with its row. The results are kept at Content-Location for the server’s retention, 72 hours by default.

  • CSV: name the columns with address (several, comma-separated, are joined), locality, region and postcode, or lat and lon for reverse. Without them, the header row’s names are matched to common ones (street, city, zip, latitude and so on). The output is the input with geocode batch’s geocode_* columns added.
  • JSONL: each line is a QUERY /geocode or QUERY /reverse item, and endpoint is required.

Every other query-string parameter, such as country, applies to every row. Each row’s answer is the one its GET returns. Send Prefer: respond-async to be answered with the job’s status once the upload is in, instead of with the results.

endpoint: optionalstring

The lookup every row of a job runs.

The lookup every row runs. Required for JSONL; for CSV, inferred from the columns.

Allowed values:geocodereverse

address: optionalstring

CSV only: the column, or comma-separated columns, holding the address.

Example

street

locality: optionalstring

CSV only: the town column.

region: optionalstring

CSV only: the region column.

postcode: optionalstring

CSV only: the postcode column.

lat: optionalstring

CSV only: the latitude column.

lon: optionalstring

CSV only: the longitude column.

country: optionalstring

Comma-separated ISO 3166-1 alpha-2 codes every row is limited to.

Example

CA

Prefer: optionalstring

respond-async to be answered with the job’s status once the upload is in.

Example

respond-async

The rows: a CSV with a header row, or one JSON object a line.

string

Example generated

example

The results, streamed as rows finish.

string

Example generated

example

Content-Location: optionalstring

The results, kept for the server’s retention.

Location: optionalstring

The job.

X-Request-Id: optionalstring

ID the request is logged under: the request’s own X-Request-Id when it sent one. Include it in bug reports.

<= 128 characters

With Prefer: respond-async: the upload is in and the job runs.

application/json

A job as GET /jobs/{id} shows it, and as it is kept on disk.

completed_at: optionalintegerformat: int64

Unix seconds, once the job stops.

created_at:integerformat: int64

Unix seconds.

endpoint:string

The lookup every row of a job runs.

Allowed values:geocodereverse

error: optionalstring

Why a failed job stopped.

expires_at: optionalintegerformat: int64

When the results are deleted. Set once the job stops.

id:string

input_format:string

A job’s file format: CSV, or one JSON object a line.

Allowed values:csvjsonl

output_format:string

A job’s file format: CSV, or one JSON object a line.

Allowed values:csvjsonl

results_url:string

status:string

Where a job is: running, or stopped and how.

Allowed values:runningcompletedcancelledfailed

summary:object

Rows answered so far.

Properties

failed:integer

Rows answered with an error.

succeeded:integer

Rows answered with a 200.

total:integer

Example

{
  "endpoint": "geocode",
  "input_format": "csv",
  "output_format": "csv",
  "status": "running"
}

Location: optionalstring

The job.

X-Request-Id: optionalstring

ID the request is logged under: the request’s own X-Request-Id when it sent one. Include it in bug reports.

<= 128 characters

The CSV has no header row or no column to look up, or a parameter is malformed.

application/problem+json

Problem

Error response, an RFC 9457 problem document.

detail: optionalstring

Human-readable explanation. Absent on 500 errors.

error_code:string

Stable error code. Branch on this.

Allowed values:invalid_queryinvalid_coordinatelimit_too_largemalformed_parametermalformed_bodynot_foundmethod_not_allowedtoo_many_itemsbody_too_largeunsupported_media_typeinternal_errorbusytimeoutpack_outdated

invalid_params: optionalArray<object>

Rejected parameters. Present only when the error is about parameters.

A rejected parameter.

Properties

name:string

Parameter name.

reason:string

Why it was rejected.

request_id: optionalstring

ID the request is logged under. Include it in bug reports.

status:integerformat: int32

>= 400<= 599

title:string

Name of the HTTP status. Do not branch on it.

type:string

URI identifying the problem type. Currently always about:blank.

Example

{
  "detail": "q must not be empty",
  "error_code": "invalid_query",
  "invalid_params": [
    {
      "name": "limit",
      "reason": "must be at most 50"
    }
  ],
  "request_id": "01JA7Q2K3M4N5P6Q7R8S9T0V1W",
  "status": 400,
  "title": "Bad Request",
  "type": "about:blank"
}

X-Request-Id: optionalstring

ID the request is logged under: the request’s own X-Request-Id when it sent one. Include it in bug reports.

<= 128 characters

Method not allowed. The route accepts POST only.

application/problem+json

Problem

Error response, an RFC 9457 problem document.

detail: optionalstring

Human-readable explanation. Absent on 500 errors.

error_code:string

Stable error code. Branch on this.

Allowed values:invalid_queryinvalid_coordinatelimit_too_largemalformed_parametermalformed_bodynot_foundmethod_not_allowedtoo_many_itemsbody_too_largeunsupported_media_typeinternal_errorbusytimeoutpack_outdated

invalid_params: optionalArray<object>

Rejected parameters. Present only when the error is about parameters.

A rejected parameter.

Properties

name:string

Parameter name.

reason:string

Why it was rejected.

request_id: optionalstring

ID the request is logged under. Include it in bug reports.

status:integerformat: int32

>= 400<= 599

title:string

Name of the HTTP status. Do not branch on it.

type:string

URI identifying the problem type. Currently always about:blank.

Example

{
  "detail": "q must not be empty",
  "error_code": "invalid_query",
  "invalid_params": [
    {
      "name": "limit",
      "reason": "must be at most 50"
    }
  ],
  "request_id": "01JA7Q2K3M4N5P6Q7R8S9T0V1W",
  "status": 400,
  "title": "Bad Request",
  "type": "about:blank"
}

Allow: optionalstring

The methods this route accepts.

Example
POST

X-Request-Id: optionalstring

ID the request is logged under: the request’s own X-Request-Id when it sent one. Include it in bug reports.

<= 128 characters

The declared body is over the server’s upload limit.

application/problem+json

Problem

Error response, an RFC 9457 problem document.

detail: optionalstring

Human-readable explanation. Absent on 500 errors.

error_code:string

Stable error code. Branch on this.

Allowed values:invalid_queryinvalid_coordinatelimit_too_largemalformed_parametermalformed_bodynot_foundmethod_not_allowedtoo_many_itemsbody_too_largeunsupported_media_typeinternal_errorbusytimeoutpack_outdated

invalid_params: optionalArray<object>

Rejected parameters. Present only when the error is about parameters.

A rejected parameter.

Properties

name:string

Parameter name.

reason:string

Why it was rejected.

request_id: optionalstring

ID the request is logged under. Include it in bug reports.

status:integerformat: int32

>= 400<= 599

title:string

Name of the HTTP status. Do not branch on it.

type:string

URI identifying the problem type. Currently always about:blank.

Example

{
  "detail": "q must not be empty",
  "error_code": "invalid_query",
  "invalid_params": [
    {
      "name": "limit",
      "reason": "must be at most 50"
    }
  ],
  "request_id": "01JA7Q2K3M4N5P6Q7R8S9T0V1W",
  "status": 400,
  "title": "Bad Request",
  "type": "about:blank"
}

X-Request-Id: optionalstring

ID the request is logged under: the request’s own X-Request-Id when it sent one. Include it in bug reports.

<= 128 characters

The body is not text/csv or application/jsonl.

application/problem+json

Problem

Error response, an RFC 9457 problem document.

detail: optionalstring

Human-readable explanation. Absent on 500 errors.

error_code:string

Stable error code. Branch on this.

Allowed values:invalid_queryinvalid_coordinatelimit_too_largemalformed_parametermalformed_bodynot_foundmethod_not_allowedtoo_many_itemsbody_too_largeunsupported_media_typeinternal_errorbusytimeoutpack_outdated

invalid_params: optionalArray<object>

Rejected parameters. Present only when the error is about parameters.

A rejected parameter.

Properties

name:string

Parameter name.

reason:string

Why it was rejected.

request_id: optionalstring

ID the request is logged under. Include it in bug reports.

status:integerformat: int32

>= 400<= 599

title:string

Name of the HTTP status. Do not branch on it.

type:string

URI identifying the problem type. Currently always about:blank.

Example

{
  "detail": "q must not be empty",
  "error_code": "invalid_query",
  "invalid_params": [
    {
      "name": "limit",
      "reason": "must be at most 50"
    }
  ],
  "request_id": "01JA7Q2K3M4N5P6Q7R8S9T0V1W",
  "status": 400,
  "title": "Bad Request",
  "type": "about:blank"
}

X-Request-Id: optionalstring

ID the request is logged under: the request’s own X-Request-Id when it sent one. Include it in bug reports.

<= 128 characters

Every slot batches and jobs share is taken, or the results kept fill the server’s job store. Retry after the Retry-After header’s seconds.

application/problem+json

Problem

Error response, an RFC 9457 problem document.

detail: optionalstring

Human-readable explanation. Absent on 500 errors.

error_code:string

Stable error code. Branch on this.

Allowed values:invalid_queryinvalid_coordinatelimit_too_largemalformed_parametermalformed_bodynot_foundmethod_not_allowedtoo_many_itemsbody_too_largeunsupported_media_typeinternal_errorbusytimeoutpack_outdated

invalid_params: optionalArray<object>

Rejected parameters. Present only when the error is about parameters.

A rejected parameter.

Properties

name:string

Parameter name.

reason:string

Why it was rejected.

request_id: optionalstring

ID the request is logged under. Include it in bug reports.

status:integerformat: int32

>= 400<= 599

title:string

Name of the HTTP status. Do not branch on it.

type:string

URI identifying the problem type. Currently always about:blank.

Example

{
  "detail": "q must not be empty",
  "error_code": "invalid_query",
  "invalid_params": [
    {
      "name": "limit",
      "reason": "must be at most 50"
    }
  ],
  "request_id": "01JA7Q2K3M4N5P6Q7R8S9T0V1W",
  "status": 400,
  "title": "Bad Request",
  "type": "about:blank"
}

X-Request-Id: optionalstring

ID the request is logged under: the request’s own X-Request-Id when it sent one. Include it in bug reports.

<= 128 characters