API User Guide 2020
API User Guide 2020
User Guide
Richard Holmes
https://ampersandstudio.uk/
February 2020
Response Format 5
Query Filters 11
Limit Query & Pagination 13
Complex Queries 14
Actor
Commands 15
Read 15
Query Filters 16
Limit Query & Pagination 16
Complex Queries 17
Actor Type
Commands 18
Read 18
Query Filters 19
Complex Queries 19
Country
Commands 21
Read 21
Region
Commands 24
Read 24
Query Filters 25
Complex Queries 25
Introduction
The following document highlights the basic steps for interacting with the Acled API. The
API is RESTful in nature and is accessed via Basic HTTP(S) authentication.
Background
Non-Commercial Licenses - ACLED’s full dataset is available for use free of charge by non-
commercial entities and organizations (e.g., non-profit organizations, government
agencies, academic institutions) using the data for non-commercial purposes, subject to
these Terms of Use. Non-commercial licenses may also be granted to for-profit media
outlets or journalists citing ACLED’s content in works of journalism; provided that such
works are made available to the general public and benefit public discourse on the topic,
subject to ACLED’s prior, written approval.
Commercial Licenses – All other commercial exploitation of ACLED content (including, but
not limited to, any sale, licensing, sublicensing, or other distribution of the data, in whole
or in part, or any incorporation of the data or analysis, in whole or in part, in a product for
sale, license, sublicense, or other distribution, to third parties for profit, or use of the data
or analysis by a commercial entity for situational awareness) is prohibited, except as
expressly agreed by ACLED in a written Commercial License Agreement executed by ACLED
and the licensee. Commercial entities seeking a commercial license to use the full ACLED
dataset must submit a request to ACLED at [email protected], including the details of
the requested use. ACLED reserves the right to withhold approval in its sole discretion. Any
approval granted is limited strictly to the use described in the corresponding request and/
or approval (which will supersede the request in the case of any inconsistency or conflict).
All commercial licensees are subject to ACLED's Terms & Conditions. By including "Accept"
in the query, they are accepting the Terms & Conditions as outlined in the linked
document.
Regardless of the type of license, all rights to use or exploit ACLED data or analysis are
conditioned on the licensee’s adherence to the Attribution Requirements outlined below.
Crawling the ACLED website or API is allowed if done in accordance with the
provisions of our robots.txt file, but scraping is prohibited.
Attribution Requirements
1. If using ACLED data in any way, direct or manipulated, the data must be clearly
acknowledged. Acknowledgement should include (1) a footnote with the full citation
which includes a/the link to ACLED’s website (see below for examples), (2) in text
citation/acknowledgement, stating where the data you use are from and that ACLED
data are publicly available, and (3) clear citation on any and all visuals making use of
ACLED data.
2. If generating a data file for public or private use, and presenting those data to
another party, the ACLED data included must be directly acknowledged in a source
column, including ACLED’s full name and a link: “Armed Conflict Location & Event Data
Project (ACLED); https://www.acleddata.com.”
3. To reference the ACLED codebook, please cite as follows (substituting for the
correct year):
“ACLED. (2017). “Armed Conflict Location & Event Data Project (ACLED) Codebook,
2017.””
“Raleigh, Clionadh, Andrew Linke, Håvard Hegre and Joakim Karlsen. (2010).
“Introducing ACLED-Armed Conflict Location and Event Data.” Journal of Peace
Research 47(5) 651-660.”
If the ACLED piece does not have an author recognized (often the case for pieces on ACLED
methodology), the citation should identify ACLED as the author.
6. If using ACLED data in a visual, graphic, map or infographic of your own, please
attribute the source data prominently on the visual itself or within the key / legend.
7. If you wish to reproduce or publish a graphic, graph or map ACLED has already
published (rather than creating an original image using raw data), please cite the
individual analysis piece or paper, including the author(s), using the following format:
Hart, Tom, and Lauren Blaxter. (23 November 2018). “Ceasefire Divisions: Violations
of the Truce with Gaza Lead to Rising Political Pressures in Israel.” Figure 1, Armed
Conflict Location & Event Data Project (ACLED). <https://www.acleddata.com/
2018/11/23/ceasefire-divisions-violations-of-the-truce-with-gaza-lead-to-rising-
political-pressures-in-israel/>. © 2018 ACLED All rights reserved. Used with
permission from ACLED.
If the ACLED piece does not have an author recognized (often the case for pieces on ACLED
methodology), the citation should identify ACLED as the author.
If you intend to use ACLED data or analysis in a manner not described in these Attribution
Requirements, contact us directly at [email protected] for instruction regarding the
attribution requirements.
If you have any other questions about the Terms of Use or Attribution Policy, or their
application, please feel free to contact us directly at [email protected].
https://api.acleddata.com/acled/read?terms=accept
last_update int The number of hours since the last update to the data
filename string The filename that will be used for csv calls
error array The details of the error with a status as an integer and
message as a string
event_date date The date the event occurred in the format: yyyy-mm-dd
timestamp int / date The unix Cmestamp this data entry was last updated
* These attributes will be returned as a new data row if export type is monadic.
Each field can be searched to filter the returned data. By default each field will search by =
or LIKE based on the table below. This can be changed by sending a new query string
name value pair, where the name has ‘_where’ appended to it. The following table shows
the default query type that will be used by each field. The terms query must be included
in all requests to indicate that you have read and accept the terms of use.
data_id = ?data_id={number}
iso = ?iso={number}
event_date = ?event_date={yyyy-mm-dd}
year = ?year={yyyy}
time_precision = ?time_precision={number}
inter1 = ?inter1={number}
inter2 = ?inter2={number}
interaction = ?interaction={number}
region = ?region={number}
longitude = ?longitude={number}
geo_precision = ?geo_precision={number}
fatalities = ?fatalities={number}
export_type = ?export_type={text}
iso3 = ?iso3={text}
References
For some attributes a number is required instead of text. The following reference tables
provides the numeric code to be used for certain content.
Rebel Forces 2
Militia Groups 3
Rioters 5
Protesters 6
Civilians 7
Foreign / Others 8
Western Africa 1
Middle Africa 2
Eastern Africa 3
Southern Africa 4
Southern Asia 7
Western Asia 8
South-Eastern Asia 9
South Asia 10
Middle East 11
Europe 12
Central America 14
South America 15
Caribbean 16
The ISO country list can be viewed here - ISO Country Link
All LIKE queries will include a wildcard before and after the entered text.
Multiple queries can be searched with name/value pairs separated by &. Each field
will be searched using AND so all arguments must match for data to be returned.
More complex queries can be searched to include the OR clause. See Complex
Queries below.
If export_type is not included it will be dyadic. For monadic export you will need to
include the export_type query.
To change the default query type you can add an additional name/value pair using the
query name and appending ‘_where’ to the query name. The query value could be LIKE or
%3D for ‘=‘. Additional types of ‘<‘, ‘>’ and ‘BETWEEN may also be used, representing less
than, greater than and between. The between requires the query name value to separate
the 2 values with a |.
Example:
?terms=accept&event_id_cnty={text}&event_id_cnty_where=%3D
?terms=accept&event_date={yyyy-mm-dd|yyyy-mm-dd}&event_date_where=BETWEEN
Example:
?terms=accept&limit=100 will return 100 rows of data (200 for monadic).
?terms=accept&page=1 will return the first 500 rows of data (1000 for monadic)
?terms=accept&page=2 will return the next 500 rows of data (1000 for monadic)
Example:
?terms=accept&fields=iso will return just the iso field.
?terms=accept&fields=iso|fatalities will return the iso and fatalities data for each row.
Complex Queries
By default all fields must match for the data to be returned. In some instances more
complex queries may be required to use the OR clause. This is possible by separating the
fields to join, by OR, with :OR: text. The main query item will be the first item in the join,
followed by the other items split with :OR: . These can be used with other queries too.
Example:
?terms=accept&{fieldname}={text}:OR:{fieldname2}={text2}:OR:{fieldname3}={text3} will
return data where field = text OR field2 = text2 OR field3 = text3.
All items wrapped in {} must be replaced with the actual fields or text required. The
curly brackets must also be removed from the query.
https://api.acleddata.com/actor/read?terms=accept
last_update int The number of hours since the last update to the data
filename string The filename that will be used for csv calls
error array The details of the error with a status as an integer and
message as a string
first_event_date date The date the first event for this actor occurred in the
format: yyyy-mm-dd
last_event_date date The date the last event for this actor occurred in the
format: yyyy-mm-dd
event_count int The number of events that have occurred with this actor
Each field can be searched to filter the returned data. By default each field will search by =
or LIKE based on the table below. This can be changed by sending a new query string
name value pair, where the name has ‘_where’ appended to it. The following table shows
the default query type that will be used by each field. The terms query must be included
in all requests to indicate that you have read and accept the terms of use.
first_event_date = ?first_event_date={yyyy-mm-dd}
last_event_date = ?last_event_date={yyyy-mm-dd}
All LIKE queries will include a wildcard before and after the entered text.
Multiple queries can be searched with name/value pairs separated by &. Each field
will be searched using AND so all arguments must match for data to be returned.
More complex queries can be searched to include the OR clause. See Complex
Queries below.
To change the default query type you can add an additional name/value pair using the
query name and appending ‘_where’ to the query name. The query value could be LIKE or
%3D for ‘=‘. Additional types of ‘<‘, ‘>’ and ‘BETWEEN may also be used, representing less
than, greater than and between. The between requires the query name value to separate
the 2 values with a |.
Example:
?terms=accept&actor_name={text}&actor_name_where=%3D
?terms=accept&last_event_date={yyyy-mm-dd|yyyy-mm-dd}&last_event_date_where=BETWEEN
Complex Queries
By default all fields must match for the data to be returned. In some instances more
complex queries may be required to use the OR clause. This is possible by separating the
fields to join, by OR, with :OR: text. The main query item will be the first item in the join,
followed by the other items split with :OR: . These can be used with other queries too.
Example:
?terms=accept&field={text}:OR:field2={text2}:OR:field3={text3} will return data where field
= text OR field2 = text2 OR field3 = text3.
https://api.acleddata.com/actortype/read?terms=accept
last_update int The number of hours since the last update to the data
filename string The filename that will be used for csv calls
error array The details of the error with a status as an integer and
message as a string
first_event_date date The date the first event for this actor type occurred in
the format: yyyy-mm-dd
last_event_date date The date the last event for this actor type occurred in
the format: yyyy-mm-dd
event_count int The number of events that have occurred with this actor
type
Each field can be searched to filter the returned data. By default each field will search by =
or LIKE based on the table below. This can be changed by sending a new query string
name value pair, where the name has ‘_where’ appended to it. The following table shows
the default query type that will be used by each field. The terms query must be included
in all requests to indicate that you have read and accept the terms of use.
actor_type_id = ?actor_type_id={number}
first_event_date = ?first_event_date={yyyy-mm-dd}
last_event_date = ?last_event_date={yyyy-mm-dd}
All LIKE queries will include a wildcard before and after the entered text.
Multiple queries can be searched with name/value pairs separated by &. Each field
will be searched using AND so all arguments must match for data to be returned.
More complex queries can be searched to include the OR clause. See Complex
Queries below.
To change the default query type you can add an additional name/value pair using the
query name and appending ‘_where’ to the query name. The query value could be LIKE or
%3D for ‘=‘. Additional types of ‘<‘, ‘>’ and ‘BETWEEN may also be used, representing less
than, greater than and between. The between requires the query name value to separate
the 2 values with a |.
Example:
?terms=accept&actor_type_name={text}&actor_type_name_where=%3D
?terms=accept&last_event_date={yyyy-mm-dd|yyyy-mm-dd}&last_event_date_where=BETWEEN
Complex Queries
By default all fields must match for the data to be returned. In some instances more
complex queries may be required to use the OR clause. This is possible by separating the
Example:
?terms=accept&field={text}:OR:field2={text2}:OR:field3={text3} will return data where field
= text OR field2 = text2 OR field3 = text3.
https://api.acleddata.com/country/read?terms=accept
last_update int The number of hours since the last update to the data
filename string The filename that will be used for csv calls
error array The details of the error with a status as an integer and
message as a string
first_event_date date The date the first event for this actor type occurred in
the format: yyyy-mm-dd
last_event_date date The date the last event for this actor type occurred in
the format: yyyy-mm-dd
event_count int The number of events that have occurred with this actor
type
Each field can be searched to filter the returned data. By default each field will search by =
or LIKE based on the table below. This can be changed by sending a new query string
name value pair, where the name has ‘_where’ appended to it. The following table shows
the default query type that will be used by each field. The terms query must be included
in all requests to indicate that you have read and accept the terms of use.
iso = ?iso={number}
iso3 = ?iso3={text}
first_event_date = ?first_event_date={yyyy-mm-dd}
last_event_date = ?last_event_date={yyyy-mm-dd}
All LIKE queries will include a wildcard before and after the entered text.
Multiple queries can be searched with name/value pairs separated by &. Each field
will be searched using AND so all arguments must match for data to be returned.
More complex queries can be searched to include the OR clause. See Complex
Queries below.
To change the default query type you can add an additional name/value pair using the
query name and appending ‘_where’ to the query name. The query value could be LIKE or
%3D for ‘=‘. Additional types of ‘<‘, ‘>’ and ‘BETWEEN may also be used, representing less
than, greater than and between. The between requires the query name value to separate
the 2 values with a |.
Example:
?terms=accept&country={text}&country_where=%3D
?terms=accept&last_event_date={yyyy-mm-dd|yyyy-mm-dd}&last_event_date_where=BETWEEN
Example:
?terms=accept&field={text}:OR:field2={text2}:OR:field3={text3} will return data where field
= text OR field2 = text2 OR field3 = text3.
https://api.acleddata.com/region/read?terms=accept
last_update int The number of hours since the last update to the data
filename string The filename that will be used for csv calls
error array The details of the error with a status as an integer and
message as a string
first_event_date date The date the first event for this actor type occurred in
the format: yyyy-mm-dd
last_event_date date The date the last event for this actor type occurred in
the format: yyyy-mm-dd
event_count int The number of events that have occurred with this actor
type
Each field can be searched to filter the returned data. By default each field will search by =
or LIKE based on the table below. This can be changed by sending a new query string
name value pair, where the name has ‘_where’ appended to it. The following table shows
the default query type that will be used by each field. The terms query must be included
in all requests to indicate that you have read and accept the terms of use.
region = ?region={number}
first_event_date = ?first_event_date={yyyy-mm-dd}
last_event_date = ?last_event_date={yyyy-mm-dd}
All LIKE queries will include a wildcard before and after the entered text.
Multiple queries can be searched with name/value pairs separated by &. Each field
will be searched using AND so all arguments must match for data to be returned.
More complex queries can be searched to include the OR clause. See Complex
Queries below.
To change the default query type you can add an additional name/value pair using the
query name and appending ‘_where’ to the query name. The query value could be LIKE or
%3D for ‘=‘. Additional types of ‘<‘, ‘>’ and ‘BETWEEN may also be used, representing less
than, greater than and between. The between requires the query name value to separate
the 2 values with a |.
Example:
?terms=accept®ion_name={text}®ion_name_where=%3D
?terms=accept&last_event_date={yyyy-mm-dd|yyyy-mm-dd}&last_event_date_where=BETWEEN
Complex Queries
By default all fields must match for the data to be returned. In some instances more
complex queries may be required to use the OR clause. This is possible by separating the
Example:
?terms=accept&field={text}:OR:field2={text2}:OR:field3={text3} will return data where field
= text OR field2 = text2 OR field3 = text3.