API Documentation

Overview

You can use the GraphQL tool to manually issue GraphQL queries. If you navigate in a web browser to GraphQL, you should see an interface that lets you enter queries. Also, we prepared a list of example queries.

Try it

Authentication

Our API requests require authentication via an API key.

You can generate an API token on the Account page after registration. Note that you will need to specify the names of hosts that will use this API token.

Here is an example of the request with the authentication header:

POST /ge/spa/graphql HTTP/1.0
Authorization: Bearer 8d490d5334159f9811d3ce760971b16d1dcef663
Content-Length: 138
Content-Type: application/json
Host: ocdsanalytics.com

{
  "query": "{ Predictions{ Unit(page: {limit: 1} filters:{eq: {field:\"title\" value: \"fuel\"}}){ values{ entity{ id  } probability }}}}"
}



200 OK
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: GET,POST,OPTIONS
Access-Control-Allow-Origin: *
Content-Type: application/json
Date: Tue, 23 Apr 2019 08:55:49 GMT
Server: gunicorn/19.9.0
Vary: Accept-Encoding

{
  "data": {
    "Predictions": {
      "Unit": {
        "values": [
          {
            "entity": {
              "id": "H87"
            },
            "probability": 0.50202125
          }
        ]
      }
    }
  }
}

If you are using our GraphQL interface, insert your API token into HTTP HEADERS section:

{
"AUTHORIZATION": "Bearer 8d490d5334159f9811d3ce760971b16d1dcef663"
}

Queries

For more details on how to work with the API and how to build queries see the Prozorro documentation.