Public · Read-only

API Reference

The Rex Africa Blog API gives you read access to published blog posts. It's a JSON REST API — no authentication required. Use it to embed Rex blog content in your own apps or websites.

Base URL
https://www.rexafrica.com/api
Format & conventions
  • All responses are application/json
  • Post IDs are returned as opaque hash strings (not raw integers)
  • Dates are ISO 8601 strings in UTC
  • Only published posts are returned

GET /blog/posts

Returns a paginated list of published blog posts, ordered newest first. Each item includes the full post content — the same shape returned by Get Post — so no separate call is needed to render a post body from this list. Optionally narrow the results by post type or by a search term matched against the title.

Query Parameters
Name Type Description
pageoptional integer Page number. Defaults to 1. Each page contains 10 results.
typeoptional string Filter by post format. One of text or video. Omit to return both. Any other value fails validation with a 422.
searchoptional string Case-insensitive substring match against the post title only (not excerpt or body content). Max 255 characters.
Response — 200 OK
JSON
{
  "current_page": 1,
  "data": [
    {
      "id":                "Mj3K9z",
      "category_id":       2,
      "type":              "text",
      "title":             "How Rex is reshaping payments in Africa",
      "slug":              "how-rex-is-reshaping-payments-in-africa",
      "excerpt":           "A short summary of the post…",
      "content":           "<p>Full HTML content…</p>",
      "video_url":         null,
      "read_time_minutes": 5,
      "video_length":      null,
      "image":             "https://…/cover.jpg",
      "author":            "Rex Editorial",
      "author_bio":        "The Rex content team.",
      "author_image":      "https://…/avatar.jpg",
      "published_at":      "2026-06-01T08:00:00.000000Z",
      "seo_title":         "How Rex is reshaping payments…",
      "seo_description":   "…",
      "og_image":          null,
      "noindex":           false,
      "created_at":        "2026-06-01T08:00:00.000000Z",
      "updated_at":        "2026-06-01T08:00:00.000000Z",
      "category":          "Product"
    }
  ],
  "first_page_url": "https://www.rexafrica.com/api/blog/posts?page=1",
  "last_page":      4,
  "last_page_url":  "https://www.rexafrica.com/api/blog/posts?page=4",
  "next_page_url":  "https://www.rexafrica.com/api/blog/posts?page=2",
  "per_page":       10,
  "prev_page_url":  null,
  "total":          34
}
Try it Live
Page
Type
Search
URL
https://www.rexafrica.com/api/blog/posts?page=1

GET /blog/posts/top-reads

Returns the most-viewed published posts, ranked by an internal view counter (highest first). This is not paginated — it always returns a flat, capped list, so it's best suited for "trending" or "popular" widgets rather than full listings. The view counter that drives this ranking is incremented automatically every time a post is fetched through the Get Post endpoint — see the note in that section for details.

The raw view count is not exposed in the response — only the ranking is. Each item includes the full post content, same shape as the List Posts endpoint.
Query Parameters
Name Type Description
limitoptional integer Number of posts to return. Defaults to 5. Must be between 1 and 20.
Response — 200 OK
JSON
{
  "data": [
    {
      "id":                "Mj3K9z",
      "category_id":       2,
      "type":              "text",
      "title":             "How Rex is reshaping payments in Africa",
      "slug":              "how-rex-is-reshaping-payments-in-africa",
      "excerpt":           "A short summary of the post…",
      "content":           "<p>Full HTML content…</p>",
      "video_url":         null,
      "read_time_minutes": 5,
      "video_length":      null,
      "image":             "https://…/cover.jpg",
      "author":            "Rex Editorial",
      "author_bio":        "The Rex content team.",
      "author_image":      "https://…/avatar.jpg",
      "published_at":      "2026-06-01T08:00:00.000000Z",
      "seo_title":         "How Rex is reshaping payments…",
      "seo_description":   "…",
      "og_image":          null,
      "noindex":           false,
      "created_at":        "2026-06-01T08:00:00.000000Z",
      "updated_at":        "2026-06-01T08:00:00.000000Z",
      "category":          "Product"
    }
  ]
}
Try it Live
Limit
URL
https://www.rexafrica.com/api/blog/posts/top-reads?limit=5


GET /blog/posts/{hash}

Returns the full content of a single published post by its hashed ID. Use the id field from the list endpoint as the hash.

Side effect: every successful call to this endpoint increments the post's internal view counter by one — this happens on the server, on every request, with no de-duplication by IP or session. That counter is what powers the Top Reads ranking, so scripts, crawlers, or repeated "try it" calls against this endpoint will directly affect that ranking. The counter itself is never returned in any API response.
Path Parameters
Name Type Description
hashrequired string The opaque post ID returned by the list endpoint (e.g. Mj3K9z).
Response — 200 OK
JSON
{
  "data": {
    "id":                "Mj3K9z",
    "category_id":       2,
    "type":              "text",
    "title":             "How Rex is reshaping payments in Africa",
    "slug":              "how-rex-is-reshaping-payments-in-africa",
    "excerpt":           "A short summary of the post…",
    "content":           "<p>Full HTML content…</p>",
    "video_url":         null,
    "read_time_minutes": 5,
    "video_length":      null,
    "image":             "https://…/cover.jpg",
    "author":            "Rex Editorial",
    "author_bio":        "The Rex content team.",
    "author_image":      "https://…/avatar.jpg",
    "published_at":      "2026-06-01T08:00:00.000000Z",
    "seo_title":         "How Rex is reshaping payments…",
    "seo_description":   "…",
    "og_image":          null,
    "noindex":           false,
    "created_at":        "2026-06-01T08:00:00.000000Z",
    "updated_at":        "2026-06-01T08:00:00.000000Z",
    "category":          "Product"
  }
}
Response — 404 Not Found
JSON
{ "message": "Not found." }
Try it Live
hash
URL
https://www.rexafrica.com/api/blog/posts/{hash}