curl --request GET \
--url https://api.onswitch.xyz/state \
--header 'x-service-key: <api-key>'{
"success": true,
"message": "States fetched successfully",
"timestamp": "2024-01-01T00:00:00.000Z",
"data": [
{
"code": "LAGOS",
"name": "Lagos"
},
{
"code": "ABUJA",
"name": "Abuja"
}
]
}Retrieve a list of states/provinces for a specific country.
curl --request GET \
--url https://api.onswitch.xyz/state \
--header 'x-service-key: <api-key>'{
"success": true,
"message": "States fetched successfully",
"timestamp": "2024-01-01T00:00:00.000Z",
"data": [
{
"code": "LAGOS",
"name": "Lagos"
},
{
"code": "ABUJA",
"name": "Abuja"
}
]
}Service key for API authentication
ISO 3166-1 alpha-2 country code