A Next.js application that serves as both an interactive logo selector UI and a REST API for UN system entity logos.
Repository: https://github.com/united-nations/logos
npm install
npm run devOpen http://localhost:3000 for the logo selector UI.
The API is available at http://localhost:3000/api/logos.
GET /api/logos
Returns all UN entities that have at least one logo available.
Query parameters:
| Parameter | Values | Default | Description |
|---|---|---|---|
mode |
light | dark | all |
all |
Filter by color mode |
format |
svg | png | jpg | pdf |
— | Filter by file format |
Example requests:
# All available logos
GET /api/logos
# SVG logos in light mode only
GET /api/logos?mode=light&format=svgExample response:
{
"count": 1,
"entities": [
{
"entity": "UN",
"entity_long": "United Nations",
"un_principal_organ": null,
"system_grouping": null,
"logos": {
"light": [
{ "format": "svg", "url": "/images/light/un.svg" },
{ "format": "png", "url": "/images/light/un.png" }
],
"dark": [
{ "format": "svg", "url": "/images/dark/un.svg" },
{ "format": "png", "url": "/images/dark/un.png" }
]
}
}
]
}GET /api/logos/{entity}
Returns logo URLs and metadata for one entity. Entity codes are case-insensitive.
Example requests:
GET /api/logos/UN
GET /api/logos/unicef?mode=dark&format=svgExample response:
{
"entity": "UN",
"entity_long": "United Nations",
"entity_description": "...",
"un_principal_organ": null,
"system_grouping": null,
"category": null,
"logos": {
"light": [
{ "format": "svg", "url": "/images/light/un.svg" },
{ "format": "png", "url": "/images/light/un.png" }
],
"dark": [
{ "format": "svg", "url": "/images/dark/un.svg" },
{ "format": "png", "url": "/images/dark/un.png" }
]
}
}Returns 404 if the entity code is not found or no logos match the filters.
Static logo files are served directly from /public/images/:
public/images/
light/
{entity}.svg
{entity}.png
dark/
{entity}.svg
{entity}.png
Files are accessible as static assets at the same URL paths (e.g. /images/light/un.svg).
Entity codes in filenames are lowercased (e.g. UNICEF → unicef.svg).
- Place logo files in
public/images/light/and/orpublic/images/dark/ - Name them
{entity_code_lowercase}.{format}(e.g.unicef.svg) - Ensure the entity exists in
public/data/un-entities.csv
The API automatically reflects any new files — no code changes required.
Deploy to Vercel, a Node.js server, or any platform that supports Next.js server-side rendering.
npm run build
npm startSet BASE_PATH to your subdirectory if serving under a path prefix:
BASE_PATH=/logos npm run buildFor GitHub Pages or other static hosts. API routes are not available in this mode.
STATIC_EXPORT=true BASE_PATH=/logos npm run build
# Output is in the `out/` directory