The code powering anapioficeandfire.com
If you want to contribute to the project, please see CONTRIBUTING.md
An API of Ice And Fire is the world's greatest source for quantified and structured data from the universe of Ice and Fire (as well as the HBO series Game of Thrones).
License: Other
The code powering anapioficeandfire.com
If you want to contribute to the project, please see CONTRIBUTING.md
There is probably some library for that. I see a possible problem if the foreign keys are "expanded" in the JSON. Maybe do the expansion only on request?
If the schema is defined, replacing
{"Id":38,"Name":"Aegon I","Culture":"","Titles":["King of All Westeros","Shield of His People","King of the Andals, the Rhoynar and the First Men","Lord of the Seven Kingdoms","Protector of the Realm","Lord of Dragonstone"],"Aliases":["Aegon the Conqueror","Aegon the Dragon","Aegon the Dragonlord"],"Born":"27 BC, at Dragonstone","Died":"37 AC, at Dragonstone","Father":59,"Mother":1070,"Spouse":2071,"Children":[57,694],"Allegiances":[],"Books":[11,9,4,6,7,1,2,3,5,8],"PovBooks":[],"PlayedBy":[""],"TvSeries":[]}
with
{"Id":38,"Name":"Aegon I","Titles":["King of All Westeros","Shield of His People","King of the Andals, the Rhoynar and the First Men","Lord of the Seven Kingdoms","Protector of the Realm","Lord of Dragonstone"],"Aliases":["Aegon the Conqueror","Aegon the Dragon","Aegon the Dragonlord"],"Born":"27 BC, at Dragonstone","Died":"37 AC, at Dragonstone","Father":59,"Mother":1070,"Spouse":2071,"Children":[57,694],"Books":[11,9,4,6,7,1,2,3,5,8]}
will save significant space.
Decide a style and implement it
The data schema is going to change rapidly (initially at least), so to make the life of client developers easier, they should be able to rely on at least one stable API version.
We want some kind of rate limiting to prevent malicious consumers
Versioning of controllers via accept headers
Transform this:
{"Id":38,"Name":"Aegon I","Culture":"Valyrian","Titles":["King of All Westeros","Shield of His People","King of the Andals, the Rhoynar and the First Men","Lord of the Seven Kingdoms","Protector of the Realm","Lord of Dragonstone"],"Aliases":["Aegon the Conqueror","Aegon the Dragon","Aegon the Dragonlord"],"Born":"27 BC, at Dragonstone","Died":"37 AC, at Dragonstone","Father":59,"Mother":1070,"Spouse":2071,"Children":[57,694],"Allegiances":[],"Books":[11,9,4,6,7,1,2,3,5,8],"PovBooks":[],"PlayedBy":[""],"TvSeries":[]}
Into:
{"Id":38,"Name":"Aegon I","Culture": 1,"Titles":[1, 2, 3, 4, 5, 6],"Aliases":["Aegon the Conqueror","Aegon the Dragon","Aegon the Dragonlord"],"Born":"27 BC, at Dragonstone","Died":"37 AC, at Dragonstone","Father":59,"Mother":1070,"Spouse":2071,"Children":[57,694],"Allegiances":[],"Books":[11,9,4,6,7,1,2,3,5,8],"PovBooks":[],"PlayedBy":[""],"TvSeries":[]},
Culture:
{"Id": 1, "Value": "Valyrian"}
Title:
{"Id": 1, "Value": "King of All Westeros"},
{"Id": 2, "Value": "Shield of His People"},
{"Id": 3, "Value": "King of the Andals, the Rhoynar and the First Men"},
{"Id": 4, "Value": "Lord of the Seven Kingdoms"},
{"Id": 5, "Value": "Protector of the Realm"},
{"Id": 6, "Value": "Lord of Dragonstone"}
etc.
According to https://www.reddit.com/r/asoiaf/comments/45lt0o/spoilers_everything_introducing_an_api_of_ice_and/czyoa78 Shireen Baratheon is missing her father and mother
We might want to implement pagination for links in resources to prevent a too big payload. A good example is Book.Characters which can have several hundreds (or even thousands) links to different Character resources.
Some fields with array values are empy but in the response they have emtpy string values in them. These should be empty arrays
A guy has created a node wrapper, it should be added to the website.
https://www.reddit.com/r/asoiaf/comments/45lt0o/spoilers_everything_introducing_an_api_of_ice_and/czyxbve
https://github.com/alexwebb2/node-api-iceandfire
Support for pagination in Link header
Implement mapping from ICharacter to Character
Get request to root endpoint should return all other endpoints
Might be good to include Last-Modified in response header so that clients can use If-Modified-Since for cache
Retrieving Characters should be made async
Unhandled exceptions should not show stack trace to consumers. Instead show a 500 error with a message that we're working on fixing the problem.
Retrieving Houses should be made async
Users should be allowed to suggest new data/corrections directly (via API). System could track these suggestions separately in the server DB, and the changes could be reviewed by people and saved to the dataset files in a batch.
Retrieving entities by name seems to be a pretty sought after feature, this would also be really simple to implement. It can either be implemented via a new action or adding filter functionality to the existing actions.
We need support for using ETag headers so that clients can use If-None-Match for cache
Retrieving the books should be made async
At the moment a whole seed of the database with the Feeder takes about 1 min. It would be nice if the whole seeding operation could take under 10 seconds.
We need support for gzip on all actions to save bandwidth
Implement mapping from IHouse to House
Write about how users can contribute to the project
Accessing any portion of the API through the urlopen function of Python 3's urllib.request library results in a 403 code being returned. This includes even the main homepage, not just calls to the API. However, access through the browser seems to work as intended, as I'm able to access JSON data directly by entering resource URLs into the navigation bar (at least, on Chrome).
I don't really think that the api should reference a link to itself, because
eg.
"allegiances": [
"http://anapioficeandfire.com/api/houses/362"
],
I know you probably didn't include the entire "house" object in the allegiance array because it would really bloat up the size of the request, however, if you instead used a "house summary" object, it could contain useful information, and still not be too bloated.
eg.
"allegiances": [
{"ID":362,
"name":"House Stark of Winterfell",
"region":"The North"}
],
This way, some useful information can be displayed from a single API call, but the ID is still included so that additional API calls can be made for more information
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.