The Open Data Portal of Valencia City Council offers several REST APIs to access the data catalogue, to obtain directly all the information of a data set and its distributions and to obtain its georeferenced open data.
This API is what CKAN implements. In the following list we include some examples of API usage:
- Simple data catalog: https://opendata.vlci.valencia.es/api/3/action/package_list
- Extended data catalog: https://opendata.vlci.valencia.es/api/3/action/package_search
- List of groups (sectors): https://opendata.vlci.valencia.es/api/3/action/group_list
- List of labels: https://opendata.vlci.valencia.es/api/3/action/tag_list
- All the information in a dataset: https://opendata.vlci.valencia.es/api/3/action/package_show?id=[id_distribucion]
All CKAN API REST documentation is available at the following address: http://docs.ckan.org/en/latest/api/index.html
In addition to this API served by CKAN, the middleware Real Time Open Data (RTOD), used to serve distributions with periodic updates, offers an API based on REST from which you can access both the list of distributions available and the data of them.
The system has a control of extensions over HTTP requests, which allows to return the representations in the requested formats. For example:
- List of distributions available in RTOD: http://apigobiernoabiertortod.valencia.es/rest/collections.json. GET Request: Returns the list of distributions available on the RTOD server along with information about them. The answer returns the identifier, title, author, number of resources and date of last update of each distribution.
- Information on a particular distribution: https://apigobiernoabiertortod.valencia.es/rest/datasets/[id_distribucion].json. GET request: Returns a list with the representation of the resources of a distribution identified by [id_distribution]. The answer returns the parameterized information of each resource in the collection. Example: http://apigobiernoabiertortod.valencia.es/rest/datasets/estado_trafico.json
Each distribution served through RTOD will be available in the formats RDF, HTML, JSON, N3, XML, TURTLE, CSV, ATOM and JSON-LD, simply by changing the distribution extension in the URL (json in the example) to rdf, html, json, n3, xml, ttl, csv, atom and json-ld respectively.
API Georeferenced data
You can also download the technical document for reusers explaining the various calls to the API Georeferenced Open Data provided by the City of Valencia grouped by a series of features such as are:
Close to me: It allows to obtain the three elements closest to the user’s position of the following points of interest, public car parks with free spaces, Valenbisi stations with available bicycles or free terminals, containers of clothes, glass, solid waste, batteries, taxi ranks, public wifi points and traffic status of the city in real time.
Points of Interest: Obtains points of interest from a position and with a determined radius of action grouped by topics such as municipal facilities, public transport, faults, monuments.