Access data based on regions, provinces, cities and barangays in the Philippines. Check the full schema here.
In local development
git clone [email protected]:darwinphi/philippine-addresses-graphql.git
Install dependecies...
npm install
...then open http://localhost:4000/graphql
curl --location --request POST 'https://ph-addresses-api.vercel.app/graphql' \
--header 'Content-Type: application/json' \
--data '{"query": "query { regions { regionName } }"}'
All Regions
regions {
regionName
...
}
All Provinces
provinces {
provinceName
...
}
All Cities
cities {
cityName
...
}
All Barangays
barangays {
brgyName
...
}
Get Provinces by Region
provinceByRegion(regionCode: String!) {
provinceName
...
}
Get Cities by Province
citiesByProvince(provinceCode: String!) {
cityName
...
}
Get Barangays by City
barangasByCity(cityCode: String!) {
cityName
...
}
Get All Addresses by Region
addresses(regionCode: String!) {
provinces {
provinceName
}
cities {
cityName
}
barangays {
brgyName
}
}
addresses(regionCode: String!) {
provinces {
provinceName
}
}
addresses(regionCode: String!) {
cities {
cityName
}
}
addresses(regionCode: String!) {
barangays {
brgyName
}
}
Philippine Statistics Authority
This project is under MIT License