# curl

> Every api.geolith.app endpoint as a curl command: search, autocomplete, structured search, reverse, nearby, place, TileJSON, tiles and health.

Set your key once, then copy any command.

```bash
export GEOLITH_API_KEY=gc_sk_your_secret_key
AUTH="Authorization: Bearer $GEOLITH_API_KEY"
```

## Search

```bash
curl -H "$AUTH" "https://api.geolith.app/v1/search?text=eiffel%20tower&size=1"
curl -H "$AUTH" "https://api.geolith.app/v1/search?text=mg%20road&boundary.country=IN&layers=address,venue&size=5"
```

## Autocomplete

```bash
curl -H "$AUTH" "https://api.geolith.app/v1/autocomplete?text=shaniwar%20wa&focus.point.lat=18.5204&focus.point.lon=73.8567&size=5"
```

## Structured search

```bash
curl -H "$AUTH" "https://api.geolith.app/v1/search/structured?address=Shaniwar%20Wada&locality=Pune&country=IN"
```

## Reverse

```bash
curl -H "$AUTH" "https://api.geolith.app/v1/reverse?point.lat=18.922&point.lon=72.8347&size=1"
```

## Nearby

```bash
curl -H "$AUTH" "https://api.geolith.app/v1/nearby?point.lat=18.5195&point.lon=73.8553&layers=venue&size=5"
```

## Place

```bash
curl -H "$AUTH" "https://api.geolith.app/v1/place?ids=geolith:locality:16174445"
```

## Tiles

```bash
curl -H "$AUTH" "https://api.geolith.app/v1/tiles/sample.json"
curl -H "$AUTH" -o tile.mvt "https://api.geolith.app/v1/tiles/sample/0/0/0.mvt"
```

## Health and quota

```bash
curl "https://api.geolith.app/health"
# The quota headers on any answered request:
curl -s -D - -o /dev/null -H "$AUTH" "https://api.geolith.app/v1/search?text=pune" | grep -i x-quota
```

Pretty-print with `| jq`, or print only labels:

```bash
curl -s -H "$AUTH" "https://api.geolith.app/v1/search?text=pune&size=3" | jq -r '.features[].properties.label'
```
