# Geocode a spreadsheet and keep the answers

> Data teams geocode CSV files of customer, store or asset addresses with geolith by calling /v1/search once per row from a script, then keep the coordinates in their warehouse; storing results permanently is allowed on every plan. The Free plan covers 100,000 rows a month; Scale covers 25,000,000 for $299. Each result includes a confidence value and a layer, so you can flag rows that matched only a city instead of an address.

## What is batch geocoding?

Batch geocoding is geocoding many addresses at once, usually a CSV or database table, and writing the coordinates back next to each row. With geolith a script sends one /v1/search request per row with a few requests in parallel, and the results may be stored permanently.

## One call per row

Read the CSV, call /v1/search with the address, write lat, lon, label, layer and confidence back. Run a few requests in parallel, not hundreds, and retry on HTTP 429 rate_limited after a short pause.

Python (requests):

```python
import requests

res = requests.get(
    "https://api.geolith.app/v1/search",
    params={"text": "Connaught Place, New Delhi", "size": 1},
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    timeout=10,
)
res.raise_for_status()
feature = res.json()["features"][0]
lon, lat = feature["geometry"]["coordinates"]
print(feature["properties"]["label"], lat, lon)
```

## Check the quality column

Sort the output by layer. Rows that matched an address or venue are usually what you want; rows that matched only a locality or region need a look. The full guide writes a matched_layer column for exactly this.

## Questions

### Is there a batch endpoint?

No. Send one request per address; the guide shows how to run a few in parallel and respect rate limits.

### Can I keep the geocoded CSV?

Yes. Results may be stored permanently. If you publish a substantial extract as a database, the ODbL share-alike terms apply to it.

## Guides

- https://geolith.app/guides/geocode-a-csv

Get a free API key (100,000 requests a month): https://console.geolith.app/signup
