Provinces of Turkey API Documentation



What is the purpose of this API?

This API allows you to get data about provinces in Turkey. 🇹🇷

If you want to see API features as Postman documentation, you can click here.

For explanation of the API in Turkish language, you can click here.

Provinces

Here are the routes related to provinces.

Get All Provinces

        GET
        https://turkiyeapi.dev/api/v1/provinces
      

You can use this route to get data for all provinces.

Query Params Type Description
name string It shows all the provinces containing or matching your search query.
minPopulation number It shows all the provinces with a population greater than or equal to the value you entered.
maxPopulation number It shows all the provinces with a population less than or equal to the value you entered.
isMetropolitan boolean It shows all the provinces that are metropolitan or not.
offset number Used for pagination. Use this to set a starting point in search results.
limit number Used for pagination. Use this to set the maximum number of results to show you.
fields string It shows the fields you want to see in the response.
sort string It sorts the results in ascending or descending order.

Get Exact Province

        GET
        https://turkiyeapi.dev/api/v1/provinces/:id
      

You can use this route to get data for exact province.

Path Variables Description
id ID of province

Query Params Type Description
fields string It shows the fields you want to see in the response.

Districts

Here are the routes related to districts.

Get All Districts

        GET
        https://turkiyeapi.dev/api/v1/districts
      

You can use this route to get data for all districts.

Query Params Type Description
name string It shows all the districts containing or matching your search query.
minPopulation number It shows all the districts with a population greater than or equal to the value you entered.
maxPopulation number It shows all the districts with a population less than or equal to the value you entered.
offset number Used for pagination. Use this to set a starting point in search results.
limit number Used for pagination. Use this to set the maximum number of results to show you.
fields string It shows the fields you want to see in the response.
sort string It sorts the results in ascending or descending order.

Get Exact District

You can use this route to get data for exact district.

        GET
        https://turkiyeapi.dev/api/v1/districts/:id
      

You can use this route to get data for all districts.

Path Variables Description
id ID of district

Query Params Type Description
fields string It shows the fields you want to see in the response.

Provinces of Turkey API is an open-source project. Click here for GitHub link! 😻