The Cities Collective API allows you to retrieve city data programmatically. All API endpoints require authentication using API keys.
Upload images to your cities programmatically using API keys. Perfect for creators who want to automate their image upload process.
View HoF Creator API Docs →Contact an administrator to get an API key. API keys must be included in theX-API-Key
header or as a Bearer token in the Authorization
header.
Include your API key in one of these ways:
X-API-Key: cc_your_api_key_here
Authorization: Bearer cc_your_api_key_here
GET /api/v1/cities?username={username}
Retrieve all cities uploaded by a specific user.
username
(required) - The username or email of the useruser
- User information (id, username, name)cities
- Array of city objectstotal
- Total number of citiesdownloadUrl
- Only included if city is downloadableprimaryImage
- Only included if city has images{ "success": true, "data": { "user": { "id": 123, "username": "citybuilder" }, "cities": [ { "id": 456, "cityName": "New York", "mapName": "Manhattan", "population": 8500000, "money": 50000000, "xp": 150, "theme": "Modern", "gameMode": "Sandbox", "downloadable": true, "downloadUrl": "https://example.com/api/cities/456/download", "uploadedAt": "2024-01-15T10:30:00Z", "primaryImage": { "thumbnail": "https://...", "medium": "https://...", "large": "https://...", "original": "https://..." }, "stats": { "likes": 25, "comments": 8 } } ], "total": 1 } }
GET /api/v1/cities/{cityId}
Retrieve detailed information about a specific city including all images, stats, and metadata.
downloadUrl
- Only included if city is downloadableprimaryImage
- Only included if city has imagesimages
- Array of all city images with metadatastats
- Like count, comment count, and total imagesuser
- City owner information{ "success": true, "data": { "id": 456, "cityName": "New York", "mapName": "Manhattan", "population": 8500000, "money": 50000000, "xp": 150, "theme": "Modern", "gameMode": "Sandbox", "autoSave": true, "leftHandTraffic": false, "naturalDisasters": true, "unlockAll": false, "unlimitedMoney": false, "unlockMapTiles": true, "simulationDate": {"year": 2024, "month": 6, "day": 15}, "contentPrerequisites": ["DLC1", "DLC2"], "modsEnabled": ["mod1", "mod2"], "fileName": "newyork.cok", "downloadable": true, "downloadUrl": "https://example.com/api/cities/456/download", "uploadedAt": "2024-01-15T10:30:00Z", "updatedAt": "2024-01-15T10:30:00Z", "primaryImage": { "id": 789, "thumbnail": "https://...", "medium": "https://...", "large": "https://...", "original": "https://..." }, "images": [ { "id": 789, "fileName": "image1.webp", "originalName": "screenshot.jpg", "fileSize": 2048576, "mimeType": "image/webp", "width": 1920, "height": 1080, "isPrimary": true, "sortOrder": 0, "uploadedAt": "2024-01-15T10:30:00Z", "urls": { "thumbnail": "https://...", "medium": "https://...", "large": "https://...", "original": "https://..." } } ], "stats": { "likes": 25, "comments": 8, "totalImages": 3 }, "user": { "id": 123, "username": "citybuilder" } } }
The API supports Cross-Origin Resource Sharing (CORS) for browser-based applications. All endpoints support OPTIONS preflight requests with the following headers:
All error responses follow this format:
{ "error": "Error message description" }
API requests are currently not rate limited, but please use the API responsibly. If you need higher limits for production use, please contact an administrator.