RSQ API API Reference
RSQ API is a full stack RESTful API allowing endpoints for entity lists, single entity access and complex query built requests. It’s a public API meaning there is no user authentication in place. API is versioned.
API Endpoint
http://api.unhcr.org/rsq/v1
Response Content-Types: application/json
Schemes: http
Version: 1.0.0
Categories and regions
GET /categories
http://api.unhcr.org/rsq/v1/categories
Returns a list of codes and names :of categories for UNHCR resettlement submissions.
Return results will be translated in requested language. Defaults to english
Valid request
Unexpected error occured
Response Example (200 OK)
[
{
"code": "LPN",
"name": "Legal and/or Physical Protection Needs"
}
]
GET /regions
http://api.unhcr.org/rsq/v1/regions
Returns a list of names of regions used by UNHCR to group Countries of Asylum.
Return results will be translated in requested language. Defaults to english
Valid request
Unxpected error occured
Response Example (200 OK)
[
{
"name": "Middle East and North Africa"
}
]
Years
GET /years
http://api.unhcr.org/rsq/v1/years
Returns a list of years for which there is available data on resettlement submissions and resettlement departures.
Valid request
Unexpected error occured
Response Example (200 OK)
[
2013,
2014,
2015,
2016,
2017
]
GET /years/demographics
http://api.unhcr.org/rsq/v1/years/demographics
Returns a list of years for which there is available data on resettlement submissions demographics.
Valid request
Unexpected error occured
Response Example (200 OK)
[
2013,
2014,
2015,
2016,
2017
]
Countries
GET /asylums
http://api.unhcr.org/rsq/v1/asylums
Returns a list of available countries of asylum.
Return results will be translated in requested language. Defaults to english
Valid request
Unexpected error occured
Response Example (200 OK)
[
{
"code": "HRV",
"name": "Croatia",
"region": "Europe"
}
]
GET /origins/submissions
http://api.unhcr.org/rsq/v1/origins/submissions
Returns a list of available countries of origin for resettlement submissions data.
Return results will be translated in requested language. Defaults to english
Valid request
Unexpected error occured
Response Example (200 OK)
[
{
"code": "HRV",
"name": "Croatia",
"region": "Europe"
}
]
GET /origins/departures
http://api.unhcr.org/rsq/v1/origins/departures
Returns a list of available countries of origin for resettlement departures data.
Return results will be translated in requested language. Defaults to english
Valid request
Unexpected error occured
Response Example (200 OK)
[
{
"code": "HRV",
"name": "Croatia",
"region": "Europe"
}
]
GET /origins/demographics
http://api.unhcr.org/rsq/v1/origins/demographics
Returns a list of available countries of origin for resettlement submissions demographics data.
Valid request
Unexpected error occured
Response Example (200 OK)
[
{
"code": "HRV",
"name": "Croatia",
"region": "Europe"
}
]
GET /destinations
http://api.unhcr.org/rsq/v1/destinations
Returns a list of available countries of resettlement.
Return results will be translated in requested language. Defaults to english
Valid request
Unexpected error occured
Response Example (200 OK)
[
{
"code": "HRV",
"name": "Croatia",
"region": "Europe"
}
]
Helper
GET /fetchUrl
http://api.unhcr.org/rsq/v1/fetchUrl?urlHash=%2336Aq
Returns a full URL for existing URL hash. Hash sign has to be converted to HTML entity.
# followed by a combination of 4 letters and/or numbers designating a unique query string
Return results will be translated in requested language. Defaults to english
Valid request
Unexpected error occured
Response Example (200 OK)
[
{
"status": "success",
"url": "http://api.unhcr.org/rsq/v1/submissions?asylum=&asylumCompare=&asylumRegion=&origin=AFG%2CBTN%2CCOD%2CERI%2CIRN%2CIRQ%2CMMR%2CSOM%2CSDN%2CSYR&originCompare=true&resettlement=&type=submissions&year=2013%2C2014%2C2015%2C2016%2C2017"
}
]
GET /export/csv
http://api.unhcr.org/rsq/v1/export/csv?type=submissions&year=2017&origin=MMR%2CSYR&resettlement=NOR%2CUSA
Returns queried data in CSV format
Valid request
Unexpected error occured
Response Example (200 OK)
"file"
Query
GET /submissions
http://api.unhcr.org/rsq/v1/submissions?page=1&year=2016%2C2017&origin=MMR%2CSYR&asylum=JOR%2CLBN&resettlement=NOR%2CUSA
Returns paginated resettlement submissions data for specific parameters. Returns 20 results per page.
Return results will be translated in requested language. Defaults to english
Current page of results
One or more available years
One or more country of origin codes
Used in combination with atleast one origin. Groups all other origins as "All others" entry in results
One or more country of asylum codes
Used in combination with atleast one asylum. Groups all other asylums as "All others" entry in results
One or more country of resettlement codes
Sort results by year ascending or descending
Sort results by country of origin ascending or descending
Sort results by country of asylum ascending or descending
Sort results by country of resettlement ascending or descending
Sort results by number of persons ascending or descending
Valid request
Unexpected error occured
Response Example (200 OK)
{
"results": [
{
"year": 2013,
"origin": "SYR",
"origin_name": "Syrian Arab Rep.",
"asylum": "JOR",
"asylum_name": "Jordan",
"destination": "NOR",
"destination_name": "Norway",
"persons": 14
}
],
"total": 12345,
"url": "#c3X3",
"page": 1,
"totalPages": 10,
"chartFilterTypes": {
"origin": "boolean",
"asylum": "boolean",
"resettlement": "boolean"
}
}
GET /departures
http://api.unhcr.org/rsq/v1/departures?page=1&year=2016%2C2017&origin=MMR%2CSYR&asylum=JOR%2CLBN&resettlement=NOR%2CUSA
Returns paginated resettlement departures data for specific parameters. Returns 20 results per page.
Return results will be translated in requested language. Defaults to english
Current page of results
One or more available years
One or more country of origin codes
Used in combination with atleast one origin. Groups all other origins as "All others" entry in results
One or more country of asylum codes
Used in combination with atleast one asylum. Groups all other asylums as "All others" entry in results
One or more country of resettlement codes
Sort results by year ascending or descending
Sort results by country of origin ascending or descending
Sort results by country of asylum ascending or descending
Sort results by country of resettlement ascending or descending
Sort results by number of persons ascending or descending
Valid request
Unexpected error occured
Response Example (200 OK)
{
"results": [
{
"year": 2013,
"origin": "SYR",
"origin_name": "Syrian Arab Rep.",
"asylum": "JOR",
"asylum_name": "Jordan",
"destination": "NOR",
"destination_name": "Norway",
"persons": 14
}
],
"total": 12345,
"url": "#c3X3",
"page": 1,
"totalPages": 10,
"chartFilterTypes": {
"origin": "boolean",
"asylum": "boolean",
"resettlement": "boolean"
}
}
GET /demographics
http://api.unhcr.org/rsq/v1/demographics?page=1&year=2017&origin=MMR%2CSYR&resettlement=NOR%2CUSA
Returns resettlement submissions demographics data for specific parameters.
Return results will be translated in requested language. Defaults to english
One or more available years
One or more country of origin codes
Used in combination with atleast one origin. Groups all other origins as "All others" entry in results
One or more country of resettlement codes
Valid request
Unexpected error occured
Response Example (200 OK)
{
"results": [
{
"year": 2013,
"origin": "SYR",
"origin_name": "Syrian Arab Rep.",
"destination": "NOR",
"destination_name": "Norway",
"femalesUnderage": 25,
"femalesAdult": 300,
"femalesSenior": 45,
"femalesUnknown": 5,
"femalesTotal": 375,
"malesUnderage": 25,
"malesAdult": 300,
"malesSenior": 45,
"malesUnknown": 5,
"malesTotal": 375,
"other": 5,
"total": 755
}
],
"url": "#c3X3"
}
Schema Definitions
Category:
- code: string
- name: string
Example
{
"code": "LPN",
"name": "Legal and/or Physical Protection Needs"
}
CountryOfAsylum:
- code: string
- name: string
- region: string
Example
{
"code": "HRV",
"name": "Croatia",
"region": "Europe"
}
CountryOfOrigin:
- code: string
- name: string
- region: string
Example
{
"code": "HRV",
"name": "Croatia",
"region": "Europe"
}
CountryOfResettlement:
- code: string
- name: string
- region: string
Example
{
"code": "HRV",
"name": "Croatia",
"region": "Europe"
}
UrlFetch:
- status: string success, invalid
- url: string
Example
{
"status": "success",
"url": "http://api.unhcr.org/rsq/v1/submissions?asylum=&asylumCompare=&asylumRegion=&origin=AFG%2CBTN%2CCOD%2CERI%2CIRN%2CIRQ%2CMMR%2CSOM%2CSDN%2CSYR&originCompare=true&resettlement=&type=submissions&year=2013%2C2014%2C2015%2C2016%2C2017"
}
ChartFilterTypes:
- origin: boolean
- asylum: boolean
- resettlement: boolean
Example
{
"origin": "boolean",
"asylum": "boolean",
"resettlement": "boolean"
}
SubmissionsResponse:
- results: Submissions
- total: integer
- url: string
- page: integer
- totalPages: integer
- chartFilterTypes: ChartFilterTypes
Example
{
"results": [
{
"year": 2013,
"origin": "SYR",
"origin_name": "Syrian Arab Rep.",
"asylum": "JOR",
"asylum_name": "Jordan",
"destination": "NOR",
"destination_name": "Norway",
"persons": 14
}
],
"total": 12345,
"url": "#c3X3",
"page": 1,
"totalPages": 10,
"chartFilterTypes": {
"origin": "boolean",
"asylum": "boolean",
"resettlement": "boolean"
}
}
Submissions:
- year: integer
- origin: string
- origin_name: string
- asylum: string
- asylum_name: string
- destination: string
- destination_name: string
- persons: integer
Example
{
"year": 2013,
"origin": "SYR",
"origin_name": "Syrian Arab Rep.",
"asylum": "JOR",
"asylum_name": "Jordan",
"destination": "NOR",
"destination_name": "Norway",
"persons": 14
}
DeparturesResponse:
- results: Departures
- total: integer
- url: string
- page: integer
- totalPages: integer
- chartFilterTypes: ChartFilterTypes
Example
{
"results": [
{
"year": 2013,
"origin": "SYR",
"origin_name": "Syrian Arab Rep.",
"asylum": "JOR",
"asylum_name": "Jordan",
"destination": "NOR",
"destination_name": "Norway",
"persons": 14
}
],
"total": 12345,
"url": "#c3X3",
"page": 1,
"totalPages": 10,
"chartFilterTypes": {
"origin": "boolean",
"asylum": "boolean",
"resettlement": "boolean"
}
}
Departures:
- year: integer
- origin: string
- origin_name: string
- asylum: string
- asylum_name: string
- destination: string
- destination_name: string
- persons: integer
Example
{
"year": 2013,
"origin": "SYR",
"origin_name": "Syrian Arab Rep.",
"asylum": "JOR",
"asylum_name": "Jordan",
"destination": "NOR",
"destination_name": "Norway",
"persons": 14
}
DemographicsResponse:
- results: Demographics
- url: string
Example
{
"results": [
{
"year": 2013,
"origin": "SYR",
"origin_name": "Syrian Arab Rep.",
"destination": "NOR",
"destination_name": "Norway",
"femalesUnderage": 25,
"femalesAdult": 300,
"femalesSenior": 45,
"femalesUnknown": 5,
"femalesTotal": 375,
"malesUnderage": 25,
"malesAdult": 300,
"malesSenior": 45,
"malesUnknown": 5,
"malesTotal": 375,
"other": 5,
"total": 755
}
],
"url": "#c3X3"
}
Demographics:
- year: integer
- origin: string
- origin_name: string
- destination: string
- destination_name: string
- femalesUnderage: integer
- femalesAdult: integer
- femalesSenior: integer
- femalesUnknown: integer
- femalesTotal: integer
- malesUnderage: integer
- malesAdult: integer
- malesSenior: integer
- malesUnknown: integer
- malesTotal: integer
- other: integer
- total: integer
Example
{
"year": 2013,
"origin": "SYR",
"origin_name": "Syrian Arab Rep.",
"destination": "NOR",
"destination_name": "Norway",
"femalesUnderage": 25,
"femalesAdult": 300,
"femalesSenior": 45,
"femalesUnknown": 5,
"femalesTotal": 375,
"malesUnderage": 25,
"malesAdult": 300,
"malesSenior": 45,
"malesUnknown": 5,
"malesTotal": 375,
"other": 5,
"total": 755
}