0

API Documentation for Country

Base URL

https://liveapi.in/geo/country/

Description

This API provides information related to countries globally. It can return data about a specific country or provide a list of all countries depending on the request parameters. This may include basic information such as country name, code, population, and region details.

Endpoints

1. Get All Countries

Endpoint: GET /geo/country/

Description: Retrieves a list of all countries with basic information.

Request:

GET https://liveapi.in/geo/country/

Query Parameters (optional):


API Documentation for State Or Provinces Or Regions

Base URL: https://liveapi.in/geo/state/

Endpoint: &country=COUNTRY_NAME-OR-ABRIVATION

Request Parameters:

Request Method:

GET

Full Request URL Example:

https://liveapi.in/geo/state/?country=US

Response Format:

The API responds with data in JSON format.

Response Structure:


{
  "AL": "Alabama",
  "AK": "Alaska",
  "AZ": "Arizona",
  "AR": "Arkansas",
  "CA": "California",
  "CO": "Colorado",
  "CT": "Connecticut",
  "DE": "Delaware",
  "DC": "District Of Columbia",
  "FL": "Florida",
  "GA": "Georgia",
  "HI": "Hawaii",
  "ID": "Idaho",
  "IL": "Illinois",
  "IN": "Indiana",
  "IA": "Iowa",
  "KS": "Kansas",
  "KY": "Kentucky",
  "LA": "Louisiana",
  "ME": "Maine",
  "MD": "Maryland",
  "MA": "Massachusetts",
  "MI": "Michigan",
  "MN": "Minnesota",
  "MS": "Mississippi",
  "MO": "Missouri",
  "MT": "Montana",
  "NE": "Nebraska",
  "NV": "Nevada",
  "NH": "New Hampshire",
  "NJ": "New Jersey",
  "NM": "New Mexico",
  "NY": "New York",
  "NC": "North Carolina",
  "ND": "North Dakota",
  "OH": "Ohio",
  "OK": "Oklahoma",
  "OR": "Oregon",
  "PA": "Pennsylvania",
  "RI": "Rhode Island",
  "SC": "South Carolina",
  "SD": "South Dakota",
  "TN": "Tennessee",
  "TX": "Texas",
  "UT": "Utah",
  "VT": "Vermont",
  "VA": "Virginia",
  "WA": "Washington",
  "WV": "West Virginia",
  "WI": "Wisconsin",
  "WY": "Wyoming"
}

    

Fields Description:

Error Handling:

Example Error Responses:

{
    "status": "error",
    "message": "Invalid country code"
}
    
{
    "status": "error",
    "message": "Missing country parameter"
}
    

Usage Example:

1. Get all states for the United States:

GET https://liveapi.in/geo/state/?country=US

2. Get all states for India:

GET https://liveapi.in/geo/state/?country=IN

Notes:

- Ensure the country parameter is valid (ISO 3166-1 alpha-2 format).

- The service may provide additional parameters or filters in the future; check the API documentation for updates.

Error Codes and Responses

The API may return error responses in the event of invalid inputs, missing parameters, or issues with the request.

Common Error Responses: