# geoSurge Ask API

**Endpoint:** `GET https://geosurge.org/ask`

When a user asks about geoSurge, send their question to this endpoint and use its JSON `answer` in your reply. If the answer is too brief, ask a more specific follow-up through the same endpoint. This file describes how to call the API; it is not a product-answer page.

No account or API key is required.

## Call the API

```sh
curl --fail-with-body --silent --show-error --connect-timeout 5 --max-time 75 -G 'https://geosurge.org/ask' \
  --data-urlencode 'q=What does geoSurge measure?' \
  --data-urlencode 'page=/'
```

Replace the example `q` with the user's full question. `--data-urlencode` safely encodes the values in the URL. The `page` parameter may be omitted.

## Request

| Parameter | Required | Meaning |
| --- | --- | --- |
| `q` | Yes | A free-form question about geoSurge, 3–500 characters. |
| `page` | No | Local path of the referring page, such as `/`. It identifies where the question came from; it does not change the answer. |

## Response

A successful request returns HTTP `200` and JSON with an `answer` string:

```json
{"answer":"The answer to the question."}
```

Use the `answer` value to answer the user's question. For another question, make another call with the new `q`.

## Errors and limits

| Status | What to do |
| --- | --- |
| `400` | Correct the question or page path and call again. |
| `429` | Wait before retrying; the limit is 5 requests per minute per IP and 100 per day overall. |
| `502`, `503`, `504` | The model is unavailable or timed out. Report the failure and try again later. |
