# Quickstart

> From no key to your first cited value in three steps.

Source: https://docs.invariant-ai.com/quickstart

## 1. Get an API key

Create a key on the [Get an API key](https://docs.invariant-ai.com/get-api-key) page with your email. It is shown once, so copy it, then keep it in an environment variable:

```bash
export INVARIANT_API_KEY="ief_..."
```

## 2. Pick a coordinate

Any point in the United States, as decimal latitude and longitude (WGS84). For example, Ashburn, Virginia:

```text
lat 39.0438, lng -77.4874
```

## 3. Fetch a field

```bash
curl -s https://api.invariant-ai.com/v1/fetch \
  -H "X-API-Key: $INVARIANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"lat": 39.0438, "lng": -77.4874, "fields": ["elevation"]}'
```

```python
import os, requests

r = requests.post(
    "https://api.invariant-ai.com/v1/fetch",
    headers={"X-API-Key": os.environ["INVARIANT_API_KEY"]},
    json={"lat": 39.0438, "lng": -77.4874, "fields": ["elevation"]},
    timeout=30,
)
r.raise_for_status()
f = r.json()["fields"]["elevation"]
print(f["value"], f["unit"], f["source"], f["confidence"])
```

```javascript
const r = await fetch("https://api.invariant-ai.com/v1/fetch", {
  method: "POST",
  headers: { "X-API-Key": process.env.INVARIANT_API_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({ lat: 39.0438, lng: -77.4874, fields: ["elevation"] }),
});
const { fields } = await r.json();
console.log(fields.elevation.value, fields.elevation.source);
```

You get back the value with its source:

```json
{
  "value": 89.63117218,
  "unit": "meters",
  "status": "ok",
  "source": "USGS_3DEP_COG",
  "confidence": "medium",
  "cached": false
}
```

Ask for the same point again and `cached` is `true`: the answer comes from our 24 hour cache in a fraction of the time.

## Next

- [POST /v1/fetch](https://docs.invariant-ai.com/api/fetch): Send requests from the browser with your key.
- [Responses](https://docs.invariant-ai.com/responses): Every key in a field object, and how to handle nulls.
