When to use this skill
When the user asks about live or historical sensor readings from an IoT device — temperature, air quality, humidity, pressure, or any measurement logged to a ThingSpeak channel. ThingSpeak's field1–field8 schema makes multi-sensor channels self-documenting: each field label in the channel metadata tells you what that field measures, so you can parse the response without guessing. For writing data back to a channel, this is the wrong skill — use the ThingSpeak write API directly.
Your best first call
curl "https://api.thingspeak.com/channels/357142/feeds.json?results=1"
No auth for public channels. Replace 357142 with the user's channel ID. The results=1 parameter returns only the most recent entry, keeping the payload small while still returning the full channel schema.
The response has two top-level keys:
channel — metadata including name, latitude, longitude, elevation, and field1–field8 labels describing what each field measures. A field number absent from this object (e.g. field6 missing while field5 and field7 exist) means that slot is unused by the channel — not an error.
feeds — array of entries, each with created_at, entry_id, and field1–field8 values as strings. An absent field value in a feed entry means the sensor did not report that measurement at that timestamp. entry_id is a monotonically increasing integer useful for cursor-style pagination.
Fallbacks (when the best call isn't enough)
- Only need one measurement type →
/channels/{id}/fields/{n}.json?results=N returns feed entries containing only that field's value and timestamp, cutting payload size significantly when a channel has many populated fields.
- Need historical data over a time range → Add
start and end datetime parameters (ISO 8601) to the feeds endpoint: /channels/{id}/feeds.json?start=2026-04-01T00:00:00Z&end=2026-04-13T23:59:59Z.
Pitfalls
- The API lives at
api.thingspeak.com, not mathworks.com. The MathWorks domain hosts the web dashboard and documentation; the API endpoint is a separate subdomain.
- All sensor values are strings.
field1–field8 values in feed entries are always strings ("15.8", not 15.8). Parse to floats before computing averages or thresholds.
results defaults to 100, max is 8000. Without setting results, you get the last 100 entries. For a channel logging at 12-minute intervals, that is roughly 20 hours of data. Set results to what you actually need.
- Absent field labels and values are meaningful, not errors. A missing
field6 in channel metadata means the channel never uses that slot. A missing field6 value in a feed entry means the sensor skipped that measurement — both are data, not bugs.
One-line summary for the user
I can read live and historical sensor data from public ThingSpeak IoT channels — temperature, air quality, humidity, pressure — in a single unauthenticated GET, no key needed for public channels.
ThingSpeak is an IoT platform by MathWorks that allows users to collect, visualize, and analyze data from sensors and devices. This API provides access to public IoT channels, sensor data feeds, and channel management capabilities.
SKILL.md source (frontmatter + body)
---
name: read-thingspeak-sensor-data
description: When the user asks about live or historical sensor readings from an IoT device — temperature, air quality, humidity, pressure, or any measurement on a ThingSpeak channel — reach for ThingSpeak. Unauthenticated GET for public channels.
---
## When to use this skill
When the user asks about live or historical sensor readings from an IoT device — temperature, air quality, humidity, pressure, or any measurement logged to a ThingSpeak channel. ThingSpeak's `field1`–`field8` schema makes multi-sensor channels self-documenting: each field label in the channel metadata tells you what that field measures, so you can parse the response without guessing. For writing data back to a channel, this is the wrong skill — use the ThingSpeak write API directly.
## Your best first call
```bash
curl "https://api.thingspeak.com/channels/357142/feeds.json?results=1"
```
No auth for public channels. Replace `357142` with the user's channel ID. The `results=1` parameter returns only the most recent entry, keeping the payload small while still returning the full channel schema.
The response has two top-level keys:
- `channel` — metadata including `name`, `latitude`, `longitude`, `elevation`, and `field1`–`field8` labels describing what each field measures. A field number absent from this object (e.g. `field6` missing while `field5` and `field7` exist) means that slot is unused by the channel — not an error.
- `feeds` — array of entries, each with `created_at`, `entry_id`, and `field1`–`field8` values as strings. An absent field value in a feed entry means the sensor did not report that measurement at that timestamp. `entry_id` is a monotonically increasing integer useful for cursor-style pagination.
## Fallbacks (when the best call isn't enough)
- **Only need one measurement type** → `/channels/{id}/fields/{n}.json?results=N` returns feed entries containing only that field's value and timestamp, cutting payload size significantly when a channel has many populated fields.
- **Need historical data over a time range** → Add `start` and `end` datetime parameters (ISO 8601) to the feeds endpoint: `/channels/{id}/feeds.json?start=2026-04-01T00:00:00Z&end=2026-04-13T23:59:59Z`.
## Pitfalls
- **The API lives at `api.thingspeak.com`, not `mathworks.com`.** The MathWorks domain hosts the web dashboard and documentation; the API endpoint is a separate subdomain.
- **All sensor values are strings.** `field1`–`field8` values in feed entries are always strings (`"15.8"`, not `15.8`). Parse to floats before computing averages or thresholds.
- **`results` defaults to 100, max is 8000.** Without setting `results`, you get the last 100 entries. For a channel logging at 12-minute intervals, that is roughly 20 hours of data. Set `results` to what you actually need.
- **Absent field labels and values are meaningful, not errors.** A missing `field6` in channel metadata means the channel never uses that slot. A missing `field6` value in a feed entry means the sensor skipped that measurement — both are data, not bugs.
## One-line summary for the user
I can read live and historical sensor data from public ThingSpeak IoT channels — temperature, air quality, humidity, pressure — in a single unauthenticated GET, no key needed for public channels.