TW Radio API

JSON API for the official mobile apps. It reads and writes the same content as the TW Radio website.

https://www.api.twradiogh.com/api

Authentication

Every /api/v1 request needs the shared app credential. Send it as a bearer token. GET /api/health does not.

Authorization: Bearer {MOBILE_API_TOKEN}
Accept: application/json

A missing or wrong token returns 401 and {"message":"Unauthenticated."}. The API allows 60 requests per minute per IP address.

Errors

  • 401 — the app token is missing or wrong.
  • 404 — the record does not exist, or it is not public (a draft article, a future article, or an inactive podcast or program).
  • 422 — the body failed validation. The response includes message and errors.
  • 429 — the rate limit was exceeded.

List responses that paginate use ?page=2. Each page has 15 records, inside data, with links and meta.

Health

GET /api/health
Public

Use this to check that the API process is responding. It does not check the database.

{
  "status": "ok"
}

News

Published articles only: status is published and published_at is not in the future. Image URLs point at the website's public storage.

GET /api/v1/news
App token

List published articles, newest first. Optional query category is a category slug.

{
  "id": 1,
  "title": "Cape Coast market",
  "slug": "cape-coast-market",
  "content": "...",
  "featured_image_url": "https://example.com/storage/news/story.jpg",
  "author": { "id": 1, "name": "Ama Mensah" },
  "category": { "id": 1, "name": "Local", "slug": "local" },
  "views": 0,
  "tags": ["local"],
  "youtube_embed": null,
  "published_at": "2026-09-27T10:00:00.000000Z",
  "likes_count": 0,
  "comments_count": 0
}
GET /api/v1/news/{id}
App token

One published article. The id is numeric. A draft or scheduled article returns 404.

GET /api/v1/categories
App token

Active categories. This list is not paginated.

{ "id": 1, "name": "Local", "slug": "local" }

Podcasts

Active episodes only, newest podcast_date first.

GET /api/v1/podcasts
App token

List active podcasts.

{
  "id": 1,
  "title": "Morning conversation",
  "description": "...",
  "thumbnail_url": "https://example.com/storage/podcasts/cover.jpg",
  "media_url": "https://example.com/storage/podcasts/audio/episode.mp3",
  "podcast_date": "2026-09-27T00:00:00.000000Z"
}
GET /api/v1/podcasts/{id}
App token

One active podcast. An inactive episode returns 404.

Programs

Listed shows only. Optional query day is Monday through Sunday. Any other value returns 422. A show is is_live when today matches its day and the current time is within one hour of its start. Times use the API server clock, which is UTC unless the app timezone is changed. Host email and phone are not included.

GET /api/v1/programs
App token

Program schedule, ordered by start time.

{
  "id": 1,
  "name": "Morning Show",
  "day": "Wednesday",
  "time": "10:00:00",
  "is_live": true,
  "schedule": {
    "id": 1,
    "title": "Talk",
    "description": "...",
    "image_url": "https://example.com/storage/programs/show.jpg",
    "host": { "id": 1, "name": "Ama", "host_bio": "..." },
    "segments": [{ "id": 1, "name": "News", "time": "10:15:00", "sort": 1 }]
  }
}
GET /api/v1/programs/{id}
App token

One listed program. An unlisted program returns 404.

GET /api/v1/on-air
App token

Today's programs plus the live stream URL. This response is not paginated.

{
  "data": {
    "stream_url": "https://a00.w3gradle.com/a21.mp3",
    "day": "Wednesday",
    "programs": []
  }
}

Events

GET /api/v1/events
App token

Events, latest date first.

{
  "id": 1,
  "title": "Festival",
  "description": "...",
  "venue": "Cape Coast",
  "thumbnail_url": "https://example.com/storage/events/cover.jpg",
  "event_date": "2026-10-05T00:00:00.000000Z",
  "event_type": { "id": 1, "name": "Concert" }
}
GET /api/v1/events/{id}
App token

One event.

GET /api/v1/event-galleries
App token

Visible gallery items only.

{
  "id": 1,
  "caption": "Festival",
  "media_urls": ["https://example.com/storage/gallery/one.jpg"],
  "event": {},
  "category": { "id": 1, "name": "Photos" }
}

Adverts

Current ads only: start_date has begun and end_date has not passed. Optional query page matches the advert page name, such as Home. Owner contact details are not included.

GET /api/v1/adverts
App token

Ads that are running now.

{
  "id": 1,
  "media_url": "https://example.com/storage/ads/home.jpg",
  "type": "Banner",
  "size": { "name": "LH_7_1.5", "width": "728.00", "height": "90.00" },
  "placement": "In-Page",
  "display": "Banner",
  "page": "Home",
  "start_date": "2026-09-27T00:00:00.000000Z",
  "end_date": "2026-10-27T00:00:00.000000Z"
}

About and contact

GET /api/v1/about
App token

Active about sections, ordered by sort_order. This list is not paginated.

{
  "id": 1,
  "title": "Our story",
  "subtitle": "...",
  "content": "...",
  "image_url": "https://example.com/storage/about/section.jpg",
  "section_type": "story",
  "sort_order": 1
}
GET /api/v1/contact
App token

Studio contact details, business hours, and social links.

{
  "data": {
    "information": {
      "phone": "0300000000",
      "email": "studio@example.com",
      "address_line1": "Cape Coast",
      "address_line2": null,
      "city": "Cape Coast",
      "country": "Ghana"
    },
    "business_hours": [{
      "id": 1,
      "day": "Monday",
      "opening_time": "08:00:00",
      "closing_time": "17:00:00",
      "is_closed": false
    }],
    "social_media": [{
      "id": 1,
      "platform": "Facebook",
      "url": "https://example.com/facebook",
      "icon": "ri-facebook-fill"
    }]
  }
}

Submissions

These create records. A successful call returns 201 and the created record in data. Send JSON.

POST /api/v1/subscribers
App token

Newsletter signup. email is required, must be a valid address, and must not already be subscribed. The stored status is subscribed.

{ "email": "listener@example.com" }
POST /api/v1/contact-messages
App token

Contact form. name is required and at least 3 characters. email and service are required. message is required and at least 10 characters. company is optional. The stored status is new.

{
  "name": "Ama Mensah",
  "company": "Coastal FM",
  "email": "ama@example.com",
  "service": "Advertising",
  "message": "We would like to advertise on the morning show."
}
GET /api/v1/partnership-interests
App token

Interest options for the partnership form. Each item is id and name.

GET /api/v1/partnership-availabilities
App token

Availability options for the partnership form. Each item is id and name.

GET /api/v1/partnership-opportunities
App token

Partnership opportunities, including the related interest.

{
  "id": 1,
  "name": "Events",
  "description": "...",
  "interest": { "id": 1, "name": "Events" }
}
POST /api/v1/partnership-applications
App token

Partnership application. name is at least 3 characters. email, phone, interest_id, and availability_id are required. interest_id and availability_id must exist. message is at least 10 characters.

{
  "name": "Ama Mensah",
  "email": "ama@example.com",
  "phone": "0240000000",
  "interest_id": 1,
  "availability_id": 1,
  "message": "I can help with weekend events."
}