EN/API/Cities

From Smart Biogas Wiki
(Redirected from EN/API/Countries/Cities)
Jump to navigation Jump to search

◀ Back to API Menu

List of European cities used in SB

All European cities have been uploaded to Smartbiogas, so performing a search without filters is slow (use the Countries API to get only the cities of a specific nation).

Direct search without passing through the Country:

https://smartbiogas.it/api/v1/cities (to be used rarely as it downloads 20Mb of data)

Result: Json with an array of results

[
	{
		"eu_cities_id": cityId,
		"eu_countries_id": countryId,
		"f_cod": "City code",
		"f_country_cod": "country code",
		"f_description": "City name",
		"f_validity_zone": 1 - North, 2- Central, 3-South, 4-Islands,
		"f_reg_description": "region description",
		"f_prov_description": "province description",
		"f_cod_catasto": "Cadastral code of the city"
	},
	{
		"eu_cities_id": 60000,
		"eu_countries_id": 19,
		"f_cod": "ITC44014047",
		"f_country_cod": "IT",
		"f_description": "Pedesina",
		"f_validity_zone": 1,
		"f_reg_description": "Lombardia",
		"f_prov_description": "Sondrio",
		"f_cod_catasto": "G410"
	},
	...
]


Single city details:

GET https://smartbiogas.it/api/v1/cities/{cityId}

Example: https://smartbiogas.it/api/v1/cities/67664

Result: Same Json as above but with a single record


Search by code:

GET https://smartbiogas.it/api/v1/cities?f_cod={city code}

Example: https://smartbiogas.it/api/v1/cities?f_cod=ITC11001191

Result: Same Json as above but with a single record


Search by description:

GET https://smartbiogas.it/api/v1/cities?f_description={string to search in the description}

Example: https://smartbiogas.it/api/v1/cities?f_description=piner

Result: Same Json as above with 0 or more records