Skip to content

Latest commit

 

History

History
298 lines (296 loc) · 18.6 KB

README.md

File metadata and controls

298 lines (296 loc) · 18.6 KB

image

Country State City API

Visit Website- https://csc.sidsworld.co.in/

APIs

To begin using our API, simply explore our documentation. Our endpoints are open and available for anyone to access, making it easy for you to integrate geographical data into your applications without any authentication requirements.

Regions

Get details about regions, including id, names, translations, and wikiDataId.

Get All Regions:

Get a list of all regions

Method: GET

Path: /api/regions

Example: /api/regions

Response:
{
    "status": 200,
    "regions":[
        {
            "id": 1,
            "name": "Africa",
            "translations": "{\"kr\":\"아프리카\",\"pt-BR\":\"África\",\"pt\":\"África\",\"nl\":\"Afrika\",\"hr\":\"Afrika\",\"fa\":\"آفریقا\",\"de\":\"Afrika\",\"es\":\"África\",\"fr\":\"Afrique\",\"ja\":\"アフリカ\",\"it\":\"Africa\",\"cn\":\"非洲\",\"tr\":\"Afrika\"}",
            "wikiDataId": "Q15",
        },
        {
            ...
        }
    ],
}

Subregions

Get details about subregions, including is names, region_id, translations and wikiDataId.

Get All Subregions:

Get a list of all subregions

Method: GET

Path: /api/subregions

Example: /api/subregions

Response:
{
    "status": 200,
    "subregions":[
        {
            "id": 1,
            "name": "Afghanistan",
            "translations": "{\"korean\":\"서아프리카\",\"portuguese\":\"África Ocidental\",\"dutch\":\"West-Afrika\",\"croatian\":\"Zapadna Afrika\",\"persian\":\"غرب آفریقا\",\"german\":\"Westafrika\",\"spanish\":\"África Occidental\",\"french\":\"Afrique de l'Ouest\",\"japanese\":\"西アフリカ\",\"italian\":\"Africa occidentale\",\"chinese\":\"西非\"}",
            "region_id": 1,
            "wikiDataId": "Q889",
        },
        {
            ...
        }
    ],
}


Get Subregion By Region Id:

Get all subregions that comes under provided region id

Method: GET

Path: /api/subregions

Parameters: regionId

Example: /api/subregions?regionId=1

Response:
{
    "status": 200,
    "subregions":[
        {
            "id": 1,
            "name": "Afghanistan",
            "translations": "{\"korean\":\"서아프리카\",\"portuguese\":\"África Ocidental\",\"dutch\":\"West-Afrika\",\"croatian\":\"Zapadna Afrika\",\"persian\":\"غرب آفریقا\",\"german\":\"Westafrika\",\"spanish\":\"África Occidental\",\"french\":\"Afrique de l'Ouest\",\"japanese\":\"西アフリカ\",\"italian\":\"Africa occidentale\",\"chinese\":\"西非\"}",
            "region_id": 1,
            "wikiDataId": "Q889",
        },
        {
            ...
        }
    ],
}

Countries

Get details about countries, including names, ISO codes, translations, etc.

Get All Countries:

Get a list of all countries

Method: GET

Path: /api/countries

Example: /api/countries

Response:
{
    "status": 200,
    "countries":[
        {
            "id": 1,
            "status": "Afghanistan",
            "iso3": AFG,
            "numeric_code": "004",
            "iso2": "AF",
            "phonecode": "93",
            "capital": "Kabul",
            "currency": "AFN",
            "currency_name": "Afghan afghani",
            "currency_symbol": "؋",
            "tld": ".af",
            "native": "افغانستان",
            "region": "Asia",
            "region_id": 3,
            "subregion": "Southern Asia",
            "subregion_id": 14,
            "nationality": "Afghan",
            "timezones": "[{\"zoneName\":\"Asia/Kabul\",\"gmtOffset\":16200,\"gmtOffsetName\":\"UTC+04:30\",\"abbreviation\":\"AFT\",\"tzName\":\"Afghanistan Time\"}]",
            "translations": "{\"kr\":\"아프가니스탄\",\"pt-BR\":\"Afeganistão\",\"pt\":\"Afeganistão\",\"nl\":\"Afghanistan\",\"hr\":\"Afganistan\",\"fa\":\"افغانستان\",\"de\":\"Afghanistan\",\"es\":\"Afganistán\",\"fr\":\"Afghanistan\",\"ja\":\"アフガニスタン\",\"it\":\"Afghanistan\",\"cn\":\"阿富汗\",\"tr\":\"Afganistan\"}",
            "latitude": "33.00000000",
            "longitude": "65.00000000",
            "emoji": "🇦🇫",
            "emojiU": "U+1F1E6 U+1F1EB",
            "wikiDataId": "Q889",
        },
        {
            ...
        }
    ],
}


Get Country By Id:

Get single country by id

Method: GET

Path: /api/countries

Parameters: id

Example: /api/countries?id=1

Response:
{
    "status": 200,
    "country":{
        "id": 1,
        "status": "Afghanistan",
        "iso3": AFG,
        "numeric_code": "004",
        "iso2": "AF",
        "phonecode": "93",
        "capital": "Kabul",
        "currency": "AFN",
        "currency_name": "Afghan afghani",
        "currency_symbol": "؋",
        "tld": ".af",
        "native": "افغانستان",
        "region": "Asia",
        "region_id": 3,
        "subregion": "Southern Asia",
        "subregion_id": 14,
        "nationality": "Afghan",
        "timezones": "[{\"zoneName\":\"Asia/Kabul\",\"gmtOffset\":16200,\"gmtOffsetName\":\"UTC+04:30\",\"abbreviation\":\"AFT\",\"tzName\":\"Afghanistan Time\"}]",
        "translations": "{\"kr\":\"아프가니스탄\",\"pt-BR\":\"Afeganistão\",\"pt\":\"Afeganistão\",\"nl\":\"Afghanistan\",\"hr\":\"Afganistan\",\"fa\":\"افغانستان\",\"de\":\"Afghanistan\",\"es\":\"Afganistán\",\"fr\":\"Afghanistan\",\"ja\":\"アフガニスタン\",\"it\":\"Afghanistan\",\"cn\":\"阿富汗\",\"tr\":\"Afganistan\"}",
        "latitude": "33.00000000",
        "longitude": "65.00000000",
        "emoji": "🇦🇫",
        "emojiU": "U+1F1E6 U+1F1EB",
        "wikiDataId": "Q889",
    },
}

States

Get a list of states by country, including names, country_id, country_code, type, etc.

Get States By Country Id :

Get a list of all states by country id

Method: GET

Path: /api/states/{countryId}

Example: /api/countries/101

Response:
{
    "status": 200,
    "states":[
        {
            "id": 1,
            "name": "Andaman and Nicobar Islands",
            "country_id": 101,
            "country_code": "IN",
            "fips_code": "01",
            "iso2": "AF",
            "type": "Union territory",
            "latitude": "11.74008670",
            "longitude": "92.65864010",
            "wikiDataId": "Q889",
        },
        {
            ...
        }
    ],
}

City

Get list of all cities in a state, including names, state_id, state_code, country_id, etc.

Get All Cities:

Get a list of all cities

Method: GET

Path: /api/cities

Example: /api/cities/4008

Response:
{
    "status": 200,
    "countries":[
        {
            "id": 1,
            "name": "Andaman and Nicobar Islands",
            "state_id": 4008,
            "state_code": "MH",
            "country_id": 101,
            "country_code": "IN",
            "latitude": "21.25665000",
            "longitude": "77.51006000",
            "wikiDataId": "Q490886",
        },
        {
            ...
        }
    ],
}

Key Features

Our API, built on Laravel, offers fast, reliable performance with comprehensive, regularly updated geographical data, ensuring easy integration for developers.

Efficiency

Our API, built on Laravel, guarantees rapid response times and dependable performance, ensuring a seamless experience for your applications.

Comprehensive Data

Access an extensive database containing detailed information on countries, states, and cities across the globe, catering to diverse geographical needs.

Easy Integration

Seamlessly integrate our API into your applications with ease, thanks to our meticulously documented endpoints and user-friendly data structure.

Regular Updates

Stay up-to-date with the latest geographical information as our database undergoes frequent updates, ensuring that you always have access to accurate and current data.

Start Building Today

Unlock the power of geographical data with the Country State City API. Dive into our documentation and start building innovative applications that leverage the richness of location-based information.

Credits

We extend our gratitude to Darshan Gada for providing the open-source database used in our API. You can find the repository at https://github.com/dr5hn/countries-states-cities-database.