Wikipedia "On This Day" as slim JSON
A OnThisDay API entrega os acontecimentos de uma data (nascimentos, mortes, eventos, feriados e destaques) a partir da Wikipedia, em JSON enxuto. Você escolhe a data, as seções, a ordem e exatamente quais campos quer receber.
The OnThisDay API serves a date's events (births, deaths, events, holidays and curated highlights) from Wikipedia as slim JSON. You pick the date, the sections, the order and exactly which fields to return.
Base: https://onthisday.api.insyde.one — aberta, sem autenticação / open, no auth.
url de cada item aponta para o artigo de origem.
url links back to the source article.
GET /?type=&month=&day=&fields=&limit=&order=&lang=
Sem nenhum parâmetro: hoje, todas as seções, campos padrão. / With no params: today, all sections, default fields.
# hoje, tudo / today, everything
curl "https://onthisday.api.insyde.one/"
# mortes em 3 de junho, só ano + texto, mais recentes primeiro
curl "https://onthisday.api.insyde.one/?type=deaths&month=6&day=3&fields=year,text&order=desc"
| Param | Padrão / Default | Descrição / Description |
|---|---|---|
type |
all |
all ou CSV de selected,births,deaths,events,holidays. / all or a CSV of those sections. |
month / day |
hoje / today | 1–12 / 1–31. Parte omitida cai para hoje (UTC). / Missing part falls back to today (UTC). |
fields |
year,text,title,extract,thumbnail,url |
CSV dos campos por item. full = todos + pages; adicione raw para o item bruto da Wikipedia. Desconhecidos são ignorados. / CSV of fields; full = all + pages; raw = untouched item. |
limit |
20 |
Itens por seção. Máx 100. 0 = sem limite. Aplicado depois da ordenação. / Items per section. Max 100. 0 = no cap. Applied after sorting. |
order |
(nativa / native) | asc / desc ordena cada seção por year. Itens sem ano (feriados) vão para o fim. / sorts each section by year; yearless items go last. |
lang |
pt |
pt, en, es, de → {lang}.wikipedia.org. |
Seções: selected (destaques curados, ~3) · births · deaths · events · holidays (sem year).
Cada item é normalizado num conjunto plano de campos. Sem fields, vem o conjunto
padrão. Peça mais ou menos com fields=a,b,c, ou tudo com fields=full.
Each item is normalized to a flat set of fields. Without fields you get the default
set. Ask for more or fewer with fields=a,b,c, or everything with fields=full.
Campos disponíveis / Available fields:
year · text · title · extract · extract_html · thumbnail · image
url · mobile_url · pageid · wikibase_item · coordinates · lang
displaytitle · description · pages (todas as páginas) · raw (item bruto)
// mínimo para IA / minimal for AI
curl "https://onthisday.api.insyde.one/?type=deaths&fields=year,text"
// tudo, incluindo o objeto bruto / everything, incl. raw upstream object
curl "https://onthisday.api.insyde.one/?type=selected&fields=full,raw&limit=1"
// GET /?type=deaths&month=6&day=3&order=desc
{
"date": "06-03",
"lang": "pt",
"type": "deaths",
"deaths": [
{
"year": 1989,
"text": "Ruhollah Khomeini, líder supremo do Irã (n. 1902).",
"title": "Ruhollah Khomeini",
"extract": "Sayyid Ruhollah Mostafavi Musavi Khomeini foi um aiatolá...",
"thumbnail": "https://upload.wikimedia.org/.../330px-...jpg",
"url": "https://pt.wikipedia.org/wiki/Ruhollah_Khomeini"
}
]
}
Para type=all, a resposta traz um array por seção (selected,
births, deaths, events, holidays).
date, lang e type sempre presentes.
For type=all, the response carries one array per section. date,
lang and type are always present.
JavaScript (fetch):
const BASE = 'https://onthisday.api.insyde.one';
async function onThisDay(opts = {}) {
const qs = new URLSearchParams(opts);
const res = await fetch(`${BASE}/?${qs}`);
if (!res.ok) throw new Error((await res.json()).error);
return res.json();
}
const { deaths } = await onThisDay({ type: 'deaths', order: 'desc', fields: 'year,text', limit: 10 });
Python (requests):
import requests
resp = requests.get("https://onthisday.api.insyde.one/", params={
"type": "births,deaths",
"month": 6, "day": 3,
"order": "desc",
"fields": "year,text,title",
"lang": "en",
})
resp.raise_for_status()
data = resp.json()
A interface plana mapeia direto num schema de function calling. O seletor fields
deixa o modelo pedir só o necessário, economizando tokens.
The flat interface maps directly to a function-calling schema. The fields selector
lets the model request only what it needs, saving tokens.
{
"name": "on_this_day",
"description": "Historical events for a calendar date from Wikipedia.",
"parameters": {
"type": "object",
"properties": {
"type": { "type": "string", "description": "all | selected | births | deaths | events | holidays (CSV ok)" },
"month": { "type": "integer", "minimum": 1, "maximum": 12 },
"day": { "type": "integer", "minimum": 1, "maximum": 31 },
"fields": { "type": "string", "description": "CSV; default year,text,title,extract,thumbnail,url" },
"order": { "type": "string", "enum": ["asc", "desc"] },
"limit": { "type": "integer" },
"lang": { "type": "string", "enum": ["pt", "en", "es", "de"] }
}
}
}
Erros: { "error": "..." } com no-store. / Errors: { "error": "..." } with no-store.
| HTTP | Quando / When |
|---|---|
400 | month/day, type ou lang inválido / invalid |
404 | caminho desconhecido / unknown path |
502 | falha ao buscar na Wikipedia / Wikipedia fetch failed |
/health e erros não são cacheados.
/health and errors are never cached.