API

This document describes OVD-Info API providing the data about criminal political persecutions in Russia.

The dataset contains detail information about the cases which took place since 2011. The data is used to power some of our projects, like these eries of dashboards and interactive articles or the database of repressions for public anti-war stance available on https://repression.info. The data published through this API contains more data and might be useful for researches and journalists.

Besides the API this data available in shortened form in CSV format.

Schema

The data generally available in two formats:

  1. Flat data, e.g. in single collection of records
  2. Objective data, e.g. collections of 10 entities interconnected with each other.

While working with flat data is easier and sometimes more useful, the original source of data is non-flat due to its nature and objective data contains more information.

The data available in 2 languages: Russian and English. In order to reduce the size of transmitted data, all the fields included in different subsets. Basic subset contains only basic attributes, whereas detailed and full containing more data.

The schema can be requested by GET query using this URL: ${API_ENDPOINT}/v1/schema.
Available options through url query params:

  1. type (type=flat will return flat schema)
  2. language (ru or en)

As a result, you will get a JSON object:

Below you may find detail description of all models.

Flat data

Field ID Field data type Subset Description

Objective data

Rest API

Flat data

The flat data API presents flat data according to the schema above. As with the schema, the data available in 2 languages and the fields included in different subsets. Basic subset contains only basic attributes, whereas detailed and full containing more data.

The data can be requested by GET query using this URL: /v1/data. Available options through url query params:

  1. language (ru or en), with default value ru
  2. subset (basic, detailed or full), with default value basic
  3. filter - data filters in format of JSON object (for example {"persecution_minor":true,"persecution_started_year":[2022,2023]} will return only persecution of minors started in 2022 and 2023), note that for a moment you can only filter data based on specific attribute value (e.g. {"persecution_minor":true} or by match with one of the values {"persecution_started_year":[2022,2023]})
  4. preset (antiwar will filter only records related to persecutions for public antiwar stance, actual will filter records related to actual persecutions, imprisoned will filter records with imprisoned people, after-invasion will filter records related to persecution started on 24/02/2022 or afterwards, before-invasion will filter records related to persecution started before 24/02/2022)
  5. csv (if true - will return data in csv file)

As a result, you will get a JSON object with total number of matching records and data:

To see how the data will change based on parameters, look at the table below with results and change the options.

Requested data can be easily used to perform calculations or render graphs. For example, below, you can see how this data used to quickly render the Observable Plot showing the current status of people persecuted for anti-war stance and gender proportion for each status.

Plot.plot({
  marginLeft: 300,
  y: { label: "Person state" },
  x: { label: "Quantity" },
  color: {scheme: "Paired"},
  marks: [
    Plot.barX((await getData('data?preset=antiwar&language=en')).data, Plot.groupY(
      { x: "count" },
      { fill: "gender_en", y: "persecution_location_en", tip: true, sort: { y: "x", reverse: true } }
    ))
  ]
})

Objective data

The objective data API presents more complex data for 10 available entities: which schema presented above and correspondent collections.

Entity name Collection name Collection url

Listing records

A listing of data can be requested by GET query using this URL: /[entityCollection]. Available options through url query params:

  1. language (ru or en), with default value ru - language of data
  2. fields - an array with specific fields you want to request
  3. subset (basic, detailed or full), with default value basic - subset of fields (see schema above)
  4. references (title, basic, detailed or full), with default value title - controls level of exposed details within referenced entities (e.g. title will return only title of reference, whereas other option allows receiving more detailed data), note that nested references will not be fetched
  5. filter - data filters in format of JSON object (for example {"persecution_minor":true,"persecution_started_year":[2022,2023]} will return only persecution of minors started in 2022 and 2023), note that for a moment you can only filter data based on specific attribute value (e.g. {"persecution_minor":true} or by match with one of the values {"persecution_started_year":[2022,2023]})
  6. preset (antiwar will filter only records of entity case related to persecutions for public antiwar stance, actual will filter records of entities persecution and person related to actual persecutions, imprisoned will filter records of entities persecution and person with imprisoned people, after-invasion will filter records of entity persecution related to persecution started on 24/02/2022 or afterwards, before-invasion will filter records of entity persecution related to persecution started before 24/02/2022) - preset of filters

As a result, you will get a JSON object with total number of matching records and data, where each record has the following structure:

  1. id - id of record
  2. type - type of entity
  3. attributes - object with entity attributes
  4. references - information about references to the other entities

Here is how the result of the request will look like for listing of persons with full preset and antiwar subset:

Objective data can be easily used to perform calculations on entity relations and render graphs. For example, below, you can see how this API used to quickly render the plot showing most popular criminal articles used in political persecutions of women.

Plot.plot({
  marginLeft: 70,
  y: { label: "Article of criminal code", type: "band" },
  x: { label: "Quantity" },
  color: {scheme: "Accent"},
  marks: [
    Plot.barX((await getData('persons?language=en&fields=["person_articles","article_number"]&filter={"person_gender_en":"female"}')).data.map(rec => rec.attributes.person_articles.map(article => article.article_number)).flat(), Plot.groupY(
      { x: "count", filter: v => v.length > 9 },
      { fill: "article_number", tip: true, sort: { y: "x", reverse: true } }
    ))
  ]
})

Obtaining entity data

The data of particular entity can be requested by GET query using this URL: /[entityCollection]/[entityId]. Available options through url query params:

  1. language (ru or en), with default value ru - language of data
  2. fields - an array with specific fields you want to request
  3. subset (basic, detailed or full), with default value basic - subset of fields (see schema above)
  4. references (title, basic, detailed or full), with default value title - controls level of exposed details within referenced entities (e.g. title will return only title of reference, whereas other option allows receiving more detailed data), note that nested references will not be fetched

Note that as in case with the response to listing request, by default attributes will contain titles of referencing entities according to the selected subset. E.g. full subset will contain information about all references and will inject all the titles of referenced data into the result. This can be changed with references attribute. You can override this behaviour, querying for specific fields with fields parameter.

Take a look how the data will change for this entity describing persecution of Alexey Gorinov depending on language, subset and references values:

Listing entity references

The general data on references of particular entity can be requested by GET query using this URL: /[entityCollection]/[entityId]/references.
The query takes the same parameters as general collection listing.
Listing of entities of specific type could be requested by this URL: /[entityCollection]/[entityId]/references/[referencedEntityCollection].

Take a look how the data will change for listing of references Alexey Gorinov persecution depending on reference type values:

Change log

2024-10-08

2024-01-16