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:
- Flat data, e.g. in single collection of records
- 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:
- type (
type=flat
will return flat schema) - language (
ru
oren
)
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:
- language (
ru
oren
), with default valueru
- subset (
basic
,detailed
orfull
), with default valuebasic
- 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]}
) - 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)
- 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:
Entity name | Collection name | Collection url |
---|
Listing records
A listing of data can be requested by GET query using this URL:
- language (
ru
oren
), with default valueru
- language of data - fields - an array with specific fields you want to request
- subset (
basic
,detailed
orfull
), with default valuebasic
- subset of fields (see schema above) - references (
title
,basic
,detailed
orfull
), with default valuetitle
- 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 - 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]}
) - 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:
- id - id of record
- type - type of entity
- attributes - object with entity attributes
- 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:
- language (
ru
oren
), with default valueru
- language of data - fields - an array with specific fields you want to request
- subset (
basic
,detailed
orfull
), with default valuebasic
- subset of fields (see schema above) - references (
title
,basic
,detailed
orfull
), with default valuetitle
- 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:
The query takes the same parameters as general collection listing.
Listing of entities of specific type could be requested by this URL:
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
- New fields for entity person of objective API:
person_imprisoned
(true if person imprisoned now),person_persecuted
(true if person under persecution now) - New fields for entity persecution of objective API and for flat API:
persecution_imprisoned
(true if person imprisoned now),persecution_actual
(true if person under persecution now) - New presets: 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
2024-01-16
- New fields with unique IDs of records:
persecution_id
(flat and objective data), person_id, criminal_case_id, sentence_id, restraint_measure_id, imprisonment_id, article_id, location_id, protest_event_id, city_id, evaluation_id
- New fields with time of last change:
last_updated
(flat data), person_last_updated, persecution_last_updated, criminal_case_last_updated