# 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= | Long-form features |
| GET /news?category=&aLaUne=true | News briefs |
| GET /item/{articles\|news}/{slug}?locale=fr\|en | One item with its body as typed blocks |
| GET /health | `ok` |

Categories: hist, cult, pol, actu, 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.
