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.
https://www.rexafrica.com/api
- 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
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.
| 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. |
{ "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 }
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.
| Name | Type | Description |
|---|---|---|
| limitoptional | integer | Number of posts to return. Defaults to 5. Must be between 1 and 20. |
{ "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" } ] }
Returns the single published post that an editor has manually flagged as featured in the admin panel — the most recently published one, if more than one is flagged. This endpoint takes no parameters and returns at most one post, so it's best suited for a homepage spotlight rather than a listing. The post includes the full content, same shape as List Posts.
{ "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" } }
{ "message": "Not found." }
Returns the full content of a single published post by its hashed ID. Use the id field from the list endpoint as the hash.
| Name | Type | Description |
|---|---|---|
| hashrequired | string | The opaque post ID returned by the list endpoint (e.g. Mj3K9z). |
{ "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" } }
{ "message": "Not found." }