const res = await fetch(
`https://api.acleddata.com/acled/read?key=${process.env.ACLED_API_KEY}&email=${process.env.ACLED_EMAIL}&country=Ukraine&year=2024&limit=5`
);
const { data } = await res.json();
data.forEach(e =>
console.log(`${e.event_date} [${e.event_type}] ${e.location}: ${e.fatalities} fatalities`)
);const res = await fetch(
`https://api.usa.gov/crime/fbi/cde/offense/state/CA/all-offenses?from=2020&to=2022&API_KEY=${process.env.FBI_API_KEY}`
);
const data = await res.json();
data.slice(0, 5).forEach(d =>
console.log(`${d.data_year}: ${d.offense_category_name} — ${d.count}`)
);const res = await fetch(
`https://visionofhumanity.org/wp-json/gpi/v1/rankings?year=2024&apikey=${process.env.GPI_API_KEY}`
);
const data = await res.json();
data.slice(0, 5).forEach((c, i) =>
console.log(`${i + 1}. ${c.country}: ${c.score} (rank ${c.rank})`)
);const res = await fetch(
'https://dataunodc.un.org/dp-crime-homicide-count?Year=2022&Subregion=Eastern+Africa'
);
// UNODC data explorer — returns HTML; use the CSV export endpoint
const csv = await fetch(
'https://dataunodc.un.org/sites/dataunodc.un.org/files/data_cts_intentional_homicide.xlsx'
);
console.log('Download UNODC homicide data:', csv.status);