GEO API PT - Provides information for Portugal on official divisional administrative regions, georeferencing, census and postal codes
RESTful API which provides information on official divisional administrative regions of Portugal (based on "Carta Administrativa Oficial de Portugal, 2022", from here). It includes information on mainland Portugal, Azores and Madeira. It also provides information on Postal Codes and Census. For more information see the resource and routines documentations.
It uses NodeJS (much faster than Python) to create a HTTP server allowing several GET requests. It pre-processes all the raw data for fast real-time delivery.
All the API documentation is at geoapi.pt/docs.
This API follows the OpenAPI Specification, thus you can see all the routes in the openapi.yaml
file.
This is the main
public repo of the geoapi.pt project
The directory structure of the main project should be like:
./ # geoapi-pt/root (private)
├── resources/ # geoapi-pt/resources (private)
├── main/ # this repo (public)
By default the server replies with text/html
format. To receive JSON format, chose one of these:
json=1
to the URL (ex.: /municipio/évora?json=1
);Accept
as JSON, that is, Accept: application/json
; orjson.geoapi.pt
(ex: json.geoapi.pt/cp/2495-300
)For pretty-printing JSON as HTML response, use in the query ?json=belo
, for example /cp/2495-300?json=belo