# The Moorish Times read API

Read-only JSON for every article and news brief on [moorishtimes.com](https://moorishtimes.com), the bilingual magazine on Moroccan history, heritage, culture and current affairs. No key is needed.

- Base URL: https://moorishtimes.com/app-api/v1
- OpenAPI 3.1: https://moorishtimes.com/app-api/v1/openapi.json
- Catalog of APIs: https://moorishtimes.com/.well-known/api-catalog

## Endpoints

| Method and path | Returns |
| --- | --- |
| GET /catalog | Every item, newest first, titles and summaries in French and English |
| GET /home | Up to 5 featured items and the 30 latest |
| GET /articles?category=&limit= | Long-form features |
| GET /news?category=&aLaUne=true&limit= | News briefs |
| GET /item/{articles\|news}/{slug}?locale=fr\|en | One item with its body as typed blocks |
| GET /health | `ok` |

The /v2 endpoints sit beside /v1, under https://moorishtimes.com/app-api:

| Method and path | Returns |
| --- | --- |
| GET /v2/item/{articles\|news}/{slug}?locale=fr\|en | One item from the content store, same shape as /v1/item |
| GET /v2/full?locale=fr\|en | Every piece of one edition with its body, newest first |
| GET /v2/changes?since=&limit= | Changes after a cursor, for keeping a copy in sync |
| GET /v2/search?q=&limit= | Pieces close in meaning to the query |

Categories: hist, cult, pol, actu (Société, formerly Actualité), sport, eco.

## Reading a body

`blocks` is an array of typed blocks (`t`): paragraph, heading, image, gallery, quote, list, references. Text arrives as runs `{text, b?, i?, href?}`. The first paragraph's `dropCap` is the opening letter, stored apart from the body: prepend it unless `dropCapInBody` is true. Skip any unknown `t`.

The same page is also available as Markdown: request https://moorishtimes.com/news/{slug} (or /articles/, with /en for English) with `Accept: text/markdown`.

## Etiquette

Responses carry ETags and are cached for 5 minutes. Send If-None-Match and expect 304. Cite with a link to the page on moorishtimes.com. Contact: info@moorishtimes.com.
