The TheyBuyForYou API is built to allow you to obtain public procurement data from the TheyBuyForYou project knowledge graph.
The API is organised around REST. All API calls should be made to the http://tbfy.librairy.linkeddata.es/kg-api/ base domain. A JSON file will be returned in all responses from the API. The API allows you 27 different resources organised in 5 main groups:
The API allows you to make paginated queries by simply adding the query param
offset since they are special variables.
To show a list with only 5 organisations, it will be enough to request it this way: GET /organisation?size=5
and if the next page is needed, it is enough using: GET /organisation?size=5&offset=1
When considering paginated queries it is necessary to set the
ORDER option in the Sparql query.
sort query param establishes the order of a solution sequence.
It contains a field name and an order modifier (either
-). Each ordering comparator is either ascending (indicated by the
+ modifier or by no modifier) or descending (indicated by the -` modifier).
Internally, R4R adds an ORDER BY clause to the SPARQL query with the closest property (by using the Levenhstein distance) to the one specified in the
Now you can make requests like this: GET /organisation?sort=-name
The API allows filtering in some fields of the resources that return lists such as name, title, description or status. The way in which a list can be filtered is by adding
?<name of the field to be filtered>=xxx in the case of text fields.
We need to obtain the list of tenders that contain the word "cluster": GET /tender?title=cluster