API

South African radio, as data.

The locl API gives your systems and AI assistants what locl hears on air: every ad with the advertiser named, mentions of the names and words you follow, transcripts, and what listeners said when they phoned in. A moment is available about a minute after it airs.

At a glance

Endpoint

https://locl.co.za/api/mcp

JSON-RPC 2.0 over HTTPS, as the Model Context Protocol (MCP) defines it. POST only.

Authentication

A key sent as Authorization: Bearer.

Workspace admins create and revoke keys in workspace settings.

Limits

60 calls per 15 minutes and 1 000 a day per workspace.

Shared by every key the workspace holds.

Freshness

A 30-second window of radio is available about 40 seconds after it starts, under a minute for nine in ten.

One call reads up to 14 days (list_mentions) or 7 (list_ads).

Connect

Two ways in: an AI assistant that speaks MCP, or your own code over HTTP.

From an AI assistant

Add the server to any MCP client (Claude Code, Cursor and others) with this config. The assistant reads the tool descriptions and calls them when a question needs them.

{
  "mcpServers": {
    "locl": {
      "type": "http",
      "url": "https://locl.co.za/api/mcp",
      "headers": {
        "Authorization": "Bearer locl_sk_…"
      }
    }
  }
}

From your own code

POST a tools/call request. There is no session to open first. This asks for the ads aired since 09:30 UTC:

curl https://locl.co.za/api/mcp \
  -H "Authorization: Bearer $LOCL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "list_ads",
      "arguments": { "since": "2026-12-02T09:30:00Z", "limit": 100 }
    }
  }'

The answer is a JSON-RPC result whose first content item holds the tool's output as a JSON string. isError is true when the tool refused the call (a bad argument, or the rate limit), and the text says why.

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [{ "type": "text", "text": "{\"window\": …, \"ads\": [ … ]}" }],
    "isError": false
  }
}

tools/list returns every tool with its parameters as JSON Schema.

Following the ads as they air

The recipe for list_ads.

  1. 1. Poll every two minutes. That is 720 calls a day, inside the daily limit with room for other calls. Every minute would pass it.
  2. 2. Overlap by 30 minutes. Set since to 30 minutes before the newest ad you hold, with limit 100. Most ads arrive within a minute, but a station can run behind (Gagasi FM by up to 20 minutes at the weekday morning peak) and a few windows are classified late.
  3. 3. Skip what you have. Keep the chunk_ids you have seen and drop repeats.
  4. 4. Follow next. When a result carries next, the window held more: call again with its since and until.

Each item is one 30-second window, not one airing: a 60-second ad usually arrives as two items with the same brand and station, back to back. To count airings, join consecutive windows of one brand on one station. Station promotions are left out, as on the Ads page, whose charts count windows the same way. An example result:

{
  "window": { "since": "2026-12-02T09:30:00.000Z", "until": "2026-12-02T10:00:00.000Z" },
  "truncated": false,
  "ads": [
    {
      "chunk_id": "d4952d10-98b9-4578-b930-fad64828e15d",
      "station": "kaya-959",
      "station_name": "Kaya 959",
      "show": "Feel Good",
      "ts_start": "2026-12-02T09:59:37.805+00:00",
      "ts_end": "2026-12-02T10:00:07.645+00:00",
      "brand": "Hollywoodbets",
      "brand_key": "hollywood bets",
      "category": "gambling",
      "category_name": "Betting & lottery",
      "confidence": 0.98,
      "text": "The richest rewards. With over 60 piping hot games to choose from…",
      "clip_url": "https://locl.co.za/clip/chunk-d4952d10-…?utm_source=api"
    }
  ]
}

Webhooks: ads pushed to you

Instead of polling list_ads, have locl POST each ad to your server.

A workspace admin adds an endpoint in workspace settings, on the API tab: an https URL and, if you want only some ads, the brands, categories or stations to send. locl shows the endpoint's signing secret once. An ad is usually delivered within a minute or two of airing, carrying the same fields as a list_ads item, up to 100 ads to a POST:

POST /locl-ads HTTP/1.1
content-type: application/json
locl-event: ad.aired
locl-delivery: 6f1c2a9e-0d4b-4c41-9a51-3b7a7f0c2d18
locl-signature: t=1764669607,v1=5d41402abc4b2a76b9719d911017c592…

{
  "id": "6f1c2a9e-0d4b-4c41-9a51-3b7a7f0c2d18",
  "type": "ad.aired",
  "created_at": "2026-12-02T10:00:07.000Z",
  "test": false,
  "data": {
    "ads": [ { "chunk_id": "d4952d10-…", "station": "kaya-959", "brand": "Hollywoodbets", … } ]
  }
}

Checking a delivery

locl-signature holds a Unix time and an HMAC-SHA256, in hex, of that time, a full stop and the raw body, keyed with the endpoint's secret. Check it before trusting a delivery, and refuse an old timestamp so a captured request cannot be replayed. In Node:

import { createHmac, timingSafeEqual } from 'node:crypto';

// rawBody: the request body exactly as received, before JSON parsing.
export function verifyLocl(secret, signatureHeader, rawBody) {
  const parts = Object.fromEntries(
    signatureHeader.split(',').map((p) => p.trim().split('=')),
  );
  const t = Number(parts.t);
  if (!Number.isFinite(t) || !parts.v1) return false;
  // Refuse anything signed more than five minutes away from now.
  if (Math.abs(Date.now() / 1000 - t) > 300) return false;
  const expected = createHmac('sha256', secret).update(`${t}.${rawBody}`).digest();
  const given = Buffer.from(parts.v1, 'hex');
  return given.length === expected.length && timingSafeEqual(given, expected);
}

Answering, retries and gaps

  • Answer with any 2xx within 10 seconds. A redirect is not followed and counts as a failure, as does an address that is not public.
  • Delivery is at least once: a POST that timed out after your server took it is sent again. Skip chunk_ids you already hold.
  • A failed POST is retried after 30 seconds, then after longer waits up to an hour. After 12 failures in a row, about six hours, the endpoint is switched off and the workspace owner is emailed. Switching it back on resumes from that moment; fill the gap with list_ads.
  • Ads arrive in the order locl classified them, which is close to, but not always, the order they aired.
  • The Send test button posts one sample ad with "test": true, signed like a real delivery.

Tool reference8 tools

Read from the server's own definitions, so this list is what it accepts today.

list_mentionsList keyword mentions

List the moments where given keywords were said on air, newest first, within a time window (default the last 24 hours, at most 14 days). Pass place to keep only moments about one suburb, town or city. This is the tool for following a subject: call it on a schedule with since set a few minutes before the newest moment you already hold (stations deliver their windows slightly out of order), and skip any chunk_id you have seen. Exact keyword matching, not meaning: use the words people say on air and OR between alternatives. Returns up to 50 moments. If truncated is true the window held older moments too: call again with until set to the ts_start of the oldest moment returned. Each moment is one ~30-second window, so a single conversation can appear as several consecutive moments.

query

required · string, up to 300 characters

Keywords: quotes for a phrase ("water outage"), OR between alternatives, -word to exclude. Example: "load shedding" OR "power outage" OR "load reduction". Words are stemmed and common words (no, the, my) are ignored, so "no water" matches every mention of water: pick distinctive words.
since

optional · date-time

ISO 8601 with offset. Start of the window (default 24 hours ago).
until

optional · date-time

ISO 8601 with offset. End of the window, exclusive (default now).
station

optional · string, up to 60 characters

Restrict to one source by slug (from list_stations), e.g. "702". Omit for all.
place

optional · string, 2 to 60 characters

Only moments tagged with this suburb, town or city, e.g. "Woodstock" or "Soweto". Tags are added by AI from the transcript, mishearings corrected; tagging began on 5 October 2026, so earlier moments are not returned when this is set.
limit

optional · integer, 1 to 50

Moments to return (default 25).
include_ads

optional · boolean

Include ad reads (default false).

list_adsList ad reads

List the adverts aired on the radio stations, newest first, within a time window (default the last hour, at most 7 days). Each read carries the advertiser as locl names it (brand, with a stable brand_key to filter or group on), its category, the station, the show, the air time and the words of the read as transcribed. To follow ads as they air, call it on a schedule (every two minutes is plenty) with since set 30 minutes before the newest read you already hold and limit 100, and skip any chunk_id you have seen. Most reads reach locl about 40 seconds after their window starts, but a station can run behind (Gagasi FM by up to 20 minutes at the weekday morning peak) and a few windows are classified late, so a short overlap misses them. Each item is one ~30-second window, so a long read can appear as two consecutive windows with the same brand and station. Station promotions are left out. Brands and words are machine-transcribed and classified, so an advertiser can be misheard or misnamed. Radio only. If next is set the window held more: call again with since and until from next, and skip the chunk_ids you already hold.

since

optional · date-time

ISO 8601 with offset. Start of the window (default 1 hour ago).
until

optional · date-time

ISO 8601 with offset. End of the window, exclusive (default now).
station

optional · string, up to 60 characters

Restrict to one source by slug (from list_stations), e.g. "702". Omit for all.
brand

optional · string, 2 to 80 characters

Only this advertiser, by name or brand_key, e.g. "Hollywoodbets" or "outsurance".
category

optional · one of insurance, banking, auto, retail, telco, healthcare, realestate, debt, energy, govt, political, tech, fmcg, travel, media, education, legal, charity, finance, gambling, home, other

Only this category: insurance, banking, auto, retail, telco, healthcare, realestate, debt, energy, govt, political, tech, fmcg, travel, media, education, legal, charity, finance, gambling, home, other.
limit

optional · integer, 10 to 100

Reads to return (default 50).

search_transcriptsSearch radio transcripts

Find the moments that best answer a question or match a topic, across South African radio and podcast transcripts, ranked by relevance (meaning and keywords together). Returns up to 20 moments, each with station, show, time, the transcript text of that ~30-second window (up to 800 characters) and a clip_url. Use it to explore a subject or find the best quote. To follow a subject over time or fetch only what is new, use list_mentions instead. Returns nothing when the subject was not on air.

query

required · string, up to 500 characters

A question, a topic, or keywords.
station

optional · string, up to 60 characters

Restrict to one source by slug (from list_stations), e.g. "702". Omit for all.
date_from

optional · date-time

ISO 8601 with offset. Only moments at or after this time.
date_to

optional · date-time

ISO 8601 with offset. Only moments at or before this time.
limit

optional · integer, 1 to 20

Moments to return (default 8).
include_ads

optional · boolean

Include ad reads (default false).

count_mentionsCount coverage

Count how much coverage keywords got, per station and per show, over a time window (default the last 7 days, at most 14). A mention is one ~30-second transcript window containing the keywords; ad reads are excluded unless asked. Answers "which station covered X most" and "how often was X mentioned". Pair it with list_mentions or search_transcripts for what was said.

query

required · string, up to 200 characters

Keyword query in alert syntax — quotes for a phrase ("load shedding"), OR between alternatives, -word to exclude. Use the proper nouns that identify the story, not a sentence.
date_from

optional · date-time

ISO 8601 with offset. Start of the window (default 7 days ago).
date_to

optional · date-time

ISO 8601 with offset. End of the window (default now).
include_ads

optional · boolean

Count ad reads too (default false — ads are airtime, not coverage).

get_chunkRead one moment in full

Fetch the full text of one chunk by chunk_id, with the chunk before and the chunk after it for context. Use it when a result was cut short, or to read the lead-in and lead-out around a moment before quoting it.

chunk_id

required · string

The chunk_id to fetch full text + context for.
context

optional · boolean

Include 1 chunk before + 1 chunk after the target for surrounding context (default true). Set false to fetch only the target chunk.

get_listener_callsWhat callers said

List what members of the public said when they phoned in to radio shows (and voice notes played on air) in the last 7 days: the caller's first name and place as aired, the topic, a one-sentence summary of their view, a short quote, and the chunk where the call starts. Also returns how many calls and minutes each show carried. Only calls that passed locl's public screen are returned. Calls are detected and summarised by AI from the transcript, so read the chunk (get_chunk) before quoting a caller. Radio only.

query

optional · string, up to 120 characters

Keywords for what the calls are about (quotes for a phrase, OR between alternatives). Omit to list every call in the window.
station

optional · string, up to 60 characters

Restrict to one source by slug (from list_stations), e.g. "702". Omit for all.
date_from

optional · date-time

ISO 8601 with offset. Start of the window (default and earliest: 7 days ago).
date_to

optional · date-time

ISO 8601 with offset. End of the window (default now).
limit

optional · integer, 1 to 30

Calls to return, newest first (default 12).

list_stationsList sources

List the radio stations and podcast feeds locl indexes, with the slug the other tools take as station. Podcast feeds have source "podcast"; only their episodes published since they were added are transcribed.

No parameters.

list_showsList a station's shows

List a radio station's shows with hosts, days and start and end times in South African time. Use it to say which show a moment aired on, or who hosts it.

station_slug

required · string

Restrict to one station, e.g. "cape-talk", "702", "safm", "power-fm", "kaya-959", "947", "5fm", "east-coast", "gagasi".

Errors and limits

  • 401 no key, or a key that was revoked.
  • 403 the workspace is not on the API plan.
  • 405 a GET; the server takes POST only.
  • Rate limit answers as a tool error with retry_after_seconds, so an assistant can read it and wait.

About the data

  • Transcripts and ad classifications are machine-made. Names, brands and numbers can be misheard, so check a moment before quoting it: its clip_url plays the audio. locl keeps audio for 30 days; an older moment plays only if a clip was made while it was held.
  • locl counts what aired. It does not know what an advertiser paid.
  • Times are UTC; South Africa is UTC+2. A podcast's time is derived from the episode's publish time.
  • list_stations returns the current stations and podcasts. Listener calls are the ones locl's public screen passed.

Getting access

The API comes with the API plan, which you subscribe to from workspace settings once you have an account. Building locl data into a product of your own, or need higher limits? Email [email protected].

How this page is made: the tool reference is generated from the API server's own tool definitions, and the limits are read from its code.

Track a name, brand, or issue while it's still on air.

Every account starts with a 7-day free trial of Pro — the full archive, alerts, clips, and chat, no card required. R199/month after; cancel anytime.