Re:Show HN: SWAPI – A Star Wars API
by anonfunction on Friday December 05, 2014 @10:46AM
(#8705050)
I think it would be nice to also provide an endpoint that lists all the resources as an array of objects where the key is the id and the value is the name. Maybe something like this:
GET /resources/ships
[
{ 1 : "Tantive IV" },
]
Re:Show HN: SWAPI – A Star Wars API
by paulhallett on Friday December 05, 2014 @10:51AM
(#8705072)
So RESTfully, I think this is normal. You should be able to call a resource and then be fed back all of those resources (usually paginated to say, 20 per request).
It will have this style of lookup.
Do you mind discussing how you did the fuzzy matching?
My initial guess would've been dynamic programming (levenstein distance), but if this is API-wide, did you make a suffix tree?
This doesn't work on pokeapi.co
Re:Show HN: SWAPI – A Star Wars API
by paulhallett on Friday December 05, 2014 @10:50AM
(#8705066)
PokeAPI is getting an update - http://phalt.co/if-you-have-data-they-will-consume-it/
and it will have better fuzzy matching.
GET /api/vehicle/t-65-x-wing
and
GET /api/planets/mustafar
will also work