RedFlags API Documentation
Overview
The purpose of the RedFlags API is to make the data collected by the RedFlags project available in a structured and automatically processable format outside the RedFlags web page. The API provides information about the collected notices and organizations in JSON format. You can access the service through HTTP requests, and the query parameters must be placed in the GET parameters of each request. The response JSON object stores the entity data or entity list in a result attribute. If it is a list, the result object has a count attribute, which stores the size of the result list. You can use the following requests and related parameters to make up the query you need.
Access authority
In order to use RedFlags API you need registration by filling the registration form. As a result of the registration you will receive an e-mail containing your unique API key. You must place your key in the "access_token" parameter of each request. The API key provides your personal access to the service, please don't pass it on.
Query for notice data
-
request: /notice
-
request type: HTTP GET
-
description: provides information about a notice in the database
-
parameters:
- id: the id of the selected notice
-
example:
- request: /notice?id=351704-2015
- response:
Query for notice list
-
request: /notices
-
request type: HTTP GET
-
description: provides a notice list that fits the given search criteria
-
parameters:
- count: the number of records displayed in the screen at once. This parameter is required, if it's missing, the API uses the default value, which is 50.
- page: the current page number in the data set. The page size is given by the count parameter. This parameter is required too, the default value is 1.
- order: the query orders the notice list by this parameter. It accepts two values: by-date and by-flags.
- contractingAuthorityNameLike: filters the result by searching for the given text in the name of the contracting authorities.
- cpvCodes: filters the result by CPV code(s). It can be a list, separated by commas.
- fromDate: filters the result by starting date, the required format is yyyy-mm-dd.
- toDate: filters the result by ending date, the required format is yyyy-mm-dd.
- doc: filters the result by the given document type, represented by one character. Acceptable parameters are:
- 0 - Prior Information Notice
- 1 - Corrigenda
- 2 - Additional information
- 3 - Contract notice
- 4 - Prequalification notices
- 5 - Request for proposals
- 6 - General information
- 7 - Contract award
- 8 - Other
- 9 - Not applicable
- B - Buyer profile
- C - Public works concession
- D - Design contest
- E - Works contracts awarded by the concessionnaire
- F - Subcontract notices
- G - European economic interest grouping (EEIG)
- I - Call for expressions of interest
- M - Periodic indicative notice (PIN) with call for competition
- O - Qualification system with call for competition
- P - Periodic indicative notice (PIN) without call for competition
- Q - Qualification system without call for competition
- R - Results of design contests
- S - European company
- V - Voluntary ex ante transparency notice
- Y - Dynamic purchasing system
- flagCountRange: filters the result by flag number(s). It can be an interval, marked with a hyphen.
- indicators: filters the result by indicator names
- textLike: searches the given text in the text data attributes of the notices.
- valueRange: filters the notices by value. It can be an interval marked with a hyphen.
- winnerNameLike: filters the result by searching for the given text in the name of the winners.
-
example:
- request: /notices?count=10&page=1&toDate=2013-01-01&contractingAuthorityNameLike=közigazgatási&flagCountRange=1-2&doc=3
- response:
Query for organization data
-
request: /organization
-
request type: HTTP GET
-
description: provides information about an organization in the database
-
parameters:
- id: the id of the selected organization
-
example:
- request: /organization?id=ORG-7d022d90afad016a3dbbafd59800b1b6
- response:
Query for organization list
-
request: /organizations
-
request type: HTTP GET
-
description: provides an organization list that fits the given search criteria
-
parameters:
- count: the number of records displayed in the screen at once. This parameter is required, if it's missing, the API uses the default value, which is 50.
- page: the current page number in the data set. The page size is given by the count parameter. This parameter is required too, the default value is 1.
- nameLike: filters the result by searching for the given text in the name of the organizations.
-
example:
- request: /organizations?count=3&page=1&nameLike=Budapest
- response:
Pagination
Each request has a limitation for the returned number of records. In the count parameter you can set the maximum number of records that can be displayed in a screen at once. If the query returns a bigger dataset, this will be divided into pages. The actual page number can be set by the page parameter of the request.
Pagination links appear in the links object of the returned JSON with the following keys:
- first: the first page of dataset
- last: the last page of dataset
- prev: the previous page of dataset
- next: the next page of dataset
If the dataset has no previous or next page, the corresponding attributes will have null value. The default value for count is 10 and its maximum value is 50.
Response messages
The API provides information messages in a message JSON object. It has a title member which contains the text of the message. For example, if the query has no result, the user will be informed the following way:
- request: /organization?id=organization
- response:
Error messages
If there are errors during the query or there are invalid parameters in the request URL, the errors object will contain information about the type of the error. The error object may contain the following attributes:
- status: the HTTP status code applicable to this problem
- title: short summary of the problem
- detail: detailed description of the problem
- source: this attribute contains references to the source of the error with the following members:
- pointer: pointer to the request entity
- parameter: the name of the URL parameter that generated the error
When a single request generates multiple errors the server will add each error to the errors array. For example, the request below has unparseable date format and invalid document type.
- request: /notices?count=10&page=1&fromDate=2013.01.01&documentType=abc
- response:
The following example shows the response when a required parameter is missing from the request.
- request: /organization
- response:
Contact
In case you find a mistake or you have any questions, you can contact us here:
info @ redflags . eu