Get started
API Endpoint https://api.westeros.com/
The Westeros API provides programmatic access to read Game of Thrones data. Retrieve a character, provide an oauth connexion, retrieve a familly, filter them, etc.
To use this API, you need an API key. Please contact us at jon.snow@nightswatch.wes to get your own API key.
get characters
# Here is a curl example
curl \
-X POST http://api.westeros.com/character/get \
-F 'secret_key=your_api_key' \
-F 'house=Stark,Bolton' \
-F 'offset=0' \
-F 'limit=50'
To get characters you need to make a POST call to the following url :
http://api.westeros.com/character/get
Result example :
{
query:{
offset: 0,
limit: 50,
house: [
"Stark",
"Bolton"
],
}
result: [
{
id: 1,
first_name: "Jon",
last_name: "Snow",
alive: true,
house: "Stark",
gender: "m",
age: 14,
location: "Winterfell"
},
{
id: 2,
first_name: "Eddard",
last_name: "Stark",
alive: false,
house: "Stark",
gender: "m",
age: 35,
location: 'Winterfell'
},
{
id: 3,
first_name: "Catelyn",
last_name: "Stark",
alive: false,
house: "Stark",
gender: "f",
age: 33,
location: "Winterfell"
},
{
id: 4,
first_name: "Roose",
last_name: "Bolton",
alive: false,
house: "Bolton",
gender: "m",
age: 40,
location: "Dreadfort"
},
{
id: 5,
first_name: "Ramsay",
last_name: "Snow",
alive: false,
house: "Bolton",
gender: "m",
age: 15,
location: "Dreadfort"
},
]
}
QUERY PARAMETERS
Field | Type | Description |
---|---|---|
secret_key | String | Your API key. |
search | String | (optional) A search word to find character by name. |
house | String | (optional) a string array of houses: |
alive | Boolean | (optional) a boolean to filter alived characters |
gender | String |
(optional) a string to filter character by gender: m: male f: female |
offset | Integer | (optional - default: 0) A cursor for use in pagination. Pagination starts offset the specified offset. |
limit | Integer | (optional - default: 10) A limit on the number of objects to be returned, between 1 and 100. |
Errors
The Westeros API uses the following error codes:
Error Code | Meaning |
---|---|
X000 | Some parameters are missing. This error appears when you don't pass every mandatory parameters. |
X001 |
Unknown or unvalid secret_key . This error appears if you use an unknow API key or if your API key expired.
|
X002 |
Unvalid secret_key for this domain. This error appears if you use an API key non specified for your domain. Developper or Universal API keys doesn't have domain checker.
|
X003 |
Unknown or unvalid user token . This error appears if you use an unknow user token or if the user token expired.
|