# Saved readings API (https://docs.palpable.technology/docs/developers/readings)

A project saves its readings over time. This API returns them, for a chart of last week, a spreadsheet or a report. For readings as they happen, use the [project API](/docs/developers/project-api).

How often a reading is saved, and for how long, is set in the project's saving settings in the app.

## Request [#request]

```http
GET https://palpable.technology/api/projects/{projectId}/readings
Authorization: Bearer pk_…
```

The key is a project key from the project's **Manage API**. A key that can only view is enough. An account key works on projects its person owns. A view's share link is refused.

Any website can call this straight from the browser. Use a view-only key there: anyone who opens the page can read the key. More in [API keys](/docs/developers/api-keys).

| Parameter | Default | |
| --- | --- | --- |
| `from` | 7 days before `to` | ISO 8601 time, for example `2026-11-15T00:00:00Z`. Included. |
| `to` | now | ISO 8601 time. Not included. Must be later than `from`. |
| `capability` | all | Comma-separated capability names, for example `temperature,humidity`. Up to 20. |
| `format` | `json` | `json` or `csv`. |

Rows come oldest first, then by module id and capability.

## Response [#response]

<Tabs items={["JSON","CSV"]}>
<Tab value="JSON">
```bash
curl -sS -H "Authorization: Bearer $PALPABLE_KEY" \
  "https://palpable.technology/api/projects/$PALPABLE_PROJECT_ID/readings?capability=temperature"
```

```json title="200 OK"
{
  "projectId": "3f9c…e21",
  "from": "2026-11-16T09:00:00.000Z",
  "to": "2026-11-23T09:00:00.000Z",
  "count": 2,
  "rows": [
    { "time_utc": "2026-11-16T09:00:00.000Z", "module_id": "modulino-thermo", "capability": "temperature", "value": 21.4, "unit": "°C" },
    { "time_utc": "2026-11-16T09:05:00.000Z", "module_id": "modulino-thermo", "capability": "temperature", "value": 21.6, "unit": "°C" }
  ]
}
```
</Tab>

<Tab value="CSV">
```bash
curl -sS -H "Authorization: Bearer $PALPABLE_KEY" \
  "https://palpable.technology/api/projects/$PALPABLE_PROJECT_ID/readings?format=csv" \
  -o readings.csv
```

```csv title="readings.csv"
time_utc,module_id,capability,value,unit
2026-11-16T09:00:00.000Z,modulino-thermo,temperature,21.4,°C
2026-11-16T09:05:00.000Z,modulino-thermo,temperature,21.6,°C
```

The response is `text/csv; charset=utf-8` with `Content-Disposition: attachment`. An empty unit is an empty cell.
</Tab>
</Tabs>

| Field | Type | |
| --- | --- | --- |
| `time_utc` | string | Start of the saved interval, ISO 8601, UTC. |
| `module_id` | string | The part, by catalogue id. |
| `capability` | string | What was measured, for example `temperature`. |
| `value` | number | The saved value for that interval. |
| `unit` | string or `null` | The unit, when there is one. |

## Limits and errors [#limits-and-errors]

One response holds at most **100,000** rows. A request that matches more is refused, never cut short:

```json title="413"
{
  "error": "Too many readings",
  "reason": "More than 100000 readings match. Narrow from and to, or ask for fewer capabilities.",
  "maxRows": 100000
}
```

Ask for a shorter range, or one capability at a time.

Errors are JSON with `error` and `reason`; a `400` also names the `field`.

| Status | When |
| --- | --- |
| `400` | `projectId` is not a UUID; `from`, `to`, `capability` or `format` is malformed; `from` is not earlier than `to`. |
| `401` | No `Authorization: Bearer` header, or the token is not a key. |
| `403` | The key can't open this project (`API key is not valid for this project`), or the token is a view's share link. |
| `413` | More than 100,000 rows match. |
| `429` | More than 30 requests a minute from one IP address. `Retry-After` says how many seconds to wait. |
| `500` | Palpable could not read the saved data. `reason` says why. |