Geocode a file
POST/jobs
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,regionandpostcode, orlatandlonfor reverse. Without them, the header row’s names are matched to common ones (street,city,zip,latitudeand so on). The output is the input withgeocode batch’sgeocode_*columns added. - JSONL: each line is a
QUERY /geocodeorQUERY /reverseitem, andendpointis 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.
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”endpoint: optionalstring
The lookup every row of a job runs.
The lookup every row runs. Required for JSONL; for CSV, inferred from the columns.
address: optionalstring
CSV only: the column, or comma-separated columns, holding the address.
Example
streetlocality: 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
CAHeader Parameters
Section titled “Header Parameters”Prefer: optionalstring
respond-async to be answered with the job’s status once the upload is in.
Example
respond-asyncRequest Bodyrequired
Section titled “Request Body required”The rows: a CSV with a header row, or one JSON object a line.
Example generated
exampleResponses
Section titled “Responses”The results, streamed as rows finish.
Example generated
exampleHeaders
Section titled “Headers”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.
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.
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.
output_format:string
A job’s file format: CSV, or one JSON object a line.
results_url:string
status:string
Where a job is: running, or stopped and how.
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"
}Headers
Section titled “Headers”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.
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.
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
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"
}Headers
Section titled “Headers”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.
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.
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
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"
}Headers
Section titled “Headers”Allow: optionalstring
The methods this route accepts.
Example
POSTX-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.
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.
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
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"
}Headers
Section titled “Headers”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.
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.
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
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"
}Headers
Section titled “Headers”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.
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.
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
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"
}Headers
Section titled “Headers”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.

