Compare Cities
const url = 'https://indepai.app/api/v1/geo/compare';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"cities":["lisbon-portugal","barcelona-spain","berlin-germany"],"monthlyBudget":2500,"priorities":{"cost":5,"safety":5,"climate":5,"internet":5,"healthcare":5}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://indepai.app/api/v1/geo/compare \ --header 'Content-Type: application/json' \ --data '{ "cities": [ "lisbon-portugal", "barcelona-spain", "berlin-germany" ], "monthlyBudget": 2500, "priorities": { "cost": 5, "safety": 5, "climate": 5, "internet": 5, "healthcare": 5 } }'Compare multiple cities side by side
Request Body
Section titled “Request Body”object
City IDs to compare
Example
[ "lisbon-portugal", "barcelona-spain", "berlin-germany"]Monthly budget for affordability calculation
Example
2500Priority weights for scoring (0-10)
object
Responses
Section titled “Responses”City comparison
object
object
object
City identifier
City name
Country name
ISO 3166-1 alpha-2 country code
Geographic region
City coordinates
object
object
Total monthly cost of living (EUR)
Monthly housing cost (EUR)
Monthly food cost (EUR)
Monthly transportation cost (EUR)
Monthly utilities cost (EUR)
Monthly entertainment cost (EUR)
Other monthly costs (EUR)
object
Overall quality of life score (0-100)
Safety score (0-100)
Healthcare quality score (0-100)
Climate score (0-100)
Internet quality score (0-100)
English-friendliness score (0-100)
object
Top marginal income tax rate (%)
Capital gains tax rate (%)
Available special tax programs
Overall nomad-friendliness score (0-100)
object
Is in Schengen area
Offers digital nomad visa
Countries with visa-free access
Local currency code
Last data update timestamp
object
object
Years of FI runway at this location
AI-generated recommendation based on priorities
object
Example
{ "success": true, "data": { "cities": [ { "id": "lisbon-portugal", "name": "Lisbon", "country": "Portugal", "countryCode": "PT", "region": "Western Europe", "coordinates": { "lat": 38.7223, "lng": -9.1393 }, "costOfLiving": { "monthlyTotal": 1800, "housing": 900, "food": 350, "transportation": 50, "utilities": 100, "entertainment": 200, "other": 200 }, "qualityOfLife": { "overall": 75, "safety": 80, "healthcare": 70, "climate": 85, "internet": 75, "englishFriendly": 70 }, "taxInfo": { "incomeTaxRate": 48, "capitalGainsTaxRate": 28, "specialPrograms": [ "NHR (Non-Habitual Resident)" ] }, "nomadScore": 82, "visaInfo": { "visaFreeFor": [ "US", "UK", "CA", "AU" ] }, "currency": "EUR" } ] }}Validation error
object
Always false for error responses
Error type
Machine-readable error code
Detailed validation errors
object
Path to the invalid field
Error message
Example
{ "success": false, "error": "Validation error", "code": "VALIDATION_ERROR", "details": [ { "path": "currentAge", "message": "Must be between 18 and 100" } ]}