News for hackers. Stuff that matters.
Re:Studio Ghibli API by owenversteeg on Thursday March 30, 2017 @03:54PM (#13998373)
I just took a look. It's 48kB uncompressed JSON. You can easily load this into a browser tab. Why is it an API?

To save anybody from copy-and-pasting it, here's ten seconds of playing around:

> ghibli

Object {films: Array(20), people: Array(16), locations: Array(25), species: Array(5), vehicles: Array(3)}

> ghibli.films[0]

Object {id: "2baf70d1-42bb-4437-b551-e5fed5a87abe", title: "Castle in the Sky", description: "The orphan Sheeta inherited a mysterious crystal t…uta's science to make himself ruler of the world.", director: "Hayao Miyazaki", producer: "Isao Takahata"…}

> ghibli.locations[0]

Object {id: "11014596-71b0-4b3e-b8c0-1c4b15f28b9a", name: "Irontown", climate: "Continental", terrain: "Mountain", surface_water: "40"…}

> ghibli.people[0]

Object {id: "ba924631-068e-4436-b6de-f3283fa848f0", name: "Ashitaka", gender: "male", age: "late teens", eye_color: "brown"…}

Re:Studio Ghibli API by flashman on Thursday March 30, 2017 @11:01PM (#14000883)
> Why is it an API?

It's not an official Studio Ghibli API. But it's exactly what you'd build if you were learning to build APIs.

Re:Studio Ghibli API by toyg on Thursday March 30, 2017 @09:24PM (#14000529)
Likely because someone wanted to play around, which is how even popular APIs like the Pokemon and StarWars ones started.

Besides, being an API it can be extended with things like quotes, exact appearance times etc etc.

Re:Studio Ghibli API by munro on Thursday March 30, 2017 @02:29PM (#13997732)
A more minimal data api. :)

    requests.get('https://raw.githubusercontent.com/janaipakos/ghibliapi/master/data.json').json()
Now it can be loaded into Pandas for analysis. Even if I was building an app I'd want to own the data 1) so my users aren't being logged by the API service 2) control over the uptime 3) lower latency 4) flexibility of serving the data, such as generating static pages.
Re:Studio Ghibli API by Something1234 on Thursday March 30, 2017 @01:10PM (#13997117)
What's with attaching the id to the url when scrolling with the next section, its a bad user experience. Jacked my back button.
Re:Studio Ghibli API by Fauntleroy on Thursday March 30, 2017 @01:37PM (#13997320)
They should be using replaceState instead of pushState
Re:Studio Ghibli API by nxrabl on Thursday March 30, 2017 @01:58PM (#13997480)
Looks like the site was generated by this [0]. They'd probably appreciate someone raising an issue.

[0] https://github.com/Rebilly/ReDoc

Re:Studio Ghibli API by romanhotsiy on Friday March 31, 2017 @12:33PM (#14005457)
ReDoc author here. Thanks folks, for submitting a bug. I've implemented this feature recently and I usually do not use back button during testing :)
Re:Studio Ghibli API by phailhaus on Thursday March 30, 2017 @01:30PM (#13997257)
Yeah. If you click the links on the left it works more intuitively, but it uses the same url routing on scroll.
Re:Studio Ghibli API by saurik on Thursday March 30, 2017 @02:27PM (#13997708)
The more I look at this the more it feels like an unofficial random project endpoint relying on trademark infringement to look important and get extra publicity than a case of "who the hell at Ghibli thought this was needed and decided to build this?".
Re:Studio Ghibli API by rena-anju on Thursday March 30, 2017 @06:38PM (#13999514)
Couldn't agree more. I see exactly _no_ potential use cases for this.
Re:Studio Ghibli API by falsedan on Thursday March 30, 2017 @02:35PM (#13997790)
I had to swipe back 6 times to return to HN so I could write a comment to complain…

More usefully, this isn't an API, it's a data source for in-universe facts! It has an API (but is not one).

Re:Studio Ghibli API by toyg on Thursday March 30, 2017 @09:47PM (#14000629)
It's like the extremely popular Pokeapi (https://pokeapi.co) or SWAPI (https://swapi.co): a service providing data over a REST interface. In other words, an API.

It's honestly the first time I see anyone claiming "an API is not an API unless it changes something".

Re:Studio Ghibli API by mikekchar on Friday March 31, 2017 @12:10AM (#14001114)
API stands for "Application Programming Interface". A website that serves up data is not an API. The best way to explain the difference is that you can write an API on a piece of paper and it is still an API (i.e., you don't have to implement it). It documents how different parts of an application interface with each other. Normally it consists of things like the definitions of functions that you can call to achieve various results.

An API is specifically not a service. You can have many services that all use the same API. REST itself is an API. You can build another API on top of REST. So if someone says they have a REST API for querying movie information, that's sensible. If you have a service that serves up movie information, that's not an API. That's a service. It uses an API.

It might seem pedantic, but I have talked with otherwise talented programmers who didn't actually know what an API was. They mentioned using "the API" in their front end code and when I asked the only reasonable question, "Which API?" they didn't know how to respond. They've got about a billion libraries in their front end code (like everyone else ;-) ) and each one of them has an API -- otherwise they couldn't use it. However "API" only meant talking to the server to them.

I realise common usage is trumping the original definition of the term, but I think that's to the detriment of everyone involved.

Re:Studio Ghibli API by nebabyte on Thursday March 30, 2017 @07:15PM (#13999774)
Yeah, I clicked into the comment thread to figure out what the hell a "Studio Ghibli API" would entail.

Mods? "Studio Ghibli dataset" or something?

Re:Studio Ghibli API by cachesking on Thursday March 30, 2017 @12:13PM (#13996640)
My guess is that this was built for practice. That said, some of the data is coming back bad. The 'url' property contains an address that is missing the 'u' and 'a'. https://ghibliapi.herokpp.com
Re:Studio Ghibli API by phinnaeus on Thursday March 30, 2017 @01:36PM (#13997303)
Re:Studio Ghibli API by knicholes on Thursday March 30, 2017 @01:04PM (#13997076)
I'd like someone to introduce slug fields to the programmers of this API. I'd like to search for species/cats and not /species/3.
Re:Studio Ghibli API by toyg on Thursday March 30, 2017 @09:43PM (#14000610)
I struggle to understand the general negativity of this thread. Like zillions of other projects seen on HN, this is just someone playing around and offering a service others may or may not find interesting.

Sure, the dataset is currently small, but it can easily get bigger if anyone starts doing things like marking appearance times, quotes with translations, pictures and so on.

Sure, it might not be an official Ghibli project, in the same way IMDB or ComicDB did not start as official projects.

I personally find it fun and will look into building something with it, just for kicks. One obvious application would be a GMap mashup with locations, at least for the realistic films. Another would be a Youtube mashup with clips for each element.

Sometimes the internet seems too cynical even for a sad old fart like me.

Re:Studio Ghibli API by norswap on Thursday March 30, 2017 @02:11PM (#13997584)
> It was created to help users discover resources

It's not the first time I see this claim in a REST API. What is it supposed to mean? Does it hint at some form of automatic (machine-driven) discovery, or is it just a pompous way to say they expose capabilities via a REST API?

Re:Studio Ghibli API by liveoneggs on Thursday March 30, 2017 @03:15PM (#13998079)
a principal of REST which is often ignored or improperly implemented is hypermedia-driven discovery. You should be able to discover the entire api via a top-level entry point which will return a bunch of links.

https://en.wikipedia.org/wiki/HATEOAS

Re:Studio Ghibli API by nailer on Friday March 31, 2017 @05:07AM (#14002151)
It's really weird:

- SOAP had discovery

- XML based REST APIs had discovery (via HATEOAS)

- JSON based REST APIs inevitably never have discovery (looks like there's no standard JSON version of the 'link rel' from HATEOAS)

- GraphQL has discovery

Re:Studio Ghibli API by liveoneggs on Friday March 31, 2017 @08:59AM (#14003215)
if you implement swagger (now openapi) then you put the discovery in: https://github.com/OAI/OpenAPI-Specification/blob/master/ver...
Re:Studio Ghibli API by er0l on Thursday March 30, 2017 @01:11PM (#13997127)
I like the formatting of this. Were any libraries used? Reminds me of Stripes API documentation a bit.
Re:Studio Ghibli API by dewey on Thursday March 30, 2017 @07:06PM (#13999715)
Re:Studio Ghibli API by huangc10 on Thursday March 30, 2017 @01:38PM (#13997323)
Cool! any chance you can add music (song, composer, album, etc.)? I think that's like one of the most wonderful things about Studio Ghibli films.
Re:Studio Ghibli API by toyg on Thursday March 30, 2017 @09:30PM (#14000550)
+1, although it can be challenging - Ghibli covers are extremely popular in Japan, they are now classics and even Ghibli themselves pushed different albums at different times. It's a bit like trying to get the original for "The Girl from Ipanema".
Re:Studio Ghibli API by erik_seaberg on Thursday March 30, 2017 @11:36PM (#14001002)
If you ever find yourself assigning a unique URL to a thing which has a name and a type, and assigning a unique URL to the type which has a name and a supertype, consider dusting off rdf:type and rdf:subClassOf and maybe JSON-LD rather than reinventing something very similar.
Re:Studio Ghibli API by johansch on Thursday March 30, 2017 @12:03PM (#13996553)
I'm confused by the thinking behind things like these. Seems like they should be static data dumps rather then network APIs. (Or why not both?)
Re:Studio Ghibli API by bpicolo on Thursday March 30, 2017 @01:06PM (#13997085)
Pretty sure it's just for funsies.
Re:Studio Ghibli API by ribosometronome on Thursday March 30, 2017 @01:32PM (#13997270)
An interesting thing to talk about in an interview, for sure.
Re:Studio Ghibli API by Zikes on Thursday March 30, 2017 @12:16PM (#13996666)
Re:Studio Ghibli API by glaberficken on Thursday March 30, 2017 @12:05PM (#13996574)
Exactly what I thought, if it's free can you just give me a dump of your tables? (maybe they are available somewhere else already?)
Re:Studio Ghibli API by xs on Thursday March 30, 2017 @12:11PM (#13996626)
Because Studio Ghibli continues to make films. So you don't have to 1) know when a new film is released 2) download a new data dump.
Re:Studio Ghibli API by icebraining on Thursday March 30, 2017 @01:02PM (#13997066)
1) That's what the If-Modified-Since header is for.

2) It's a bunch of text data; as the link posted in another comment shows, it's less than 50kB uncompressed.

Re:Studio Ghibli API by robertlagrant on Thursday March 30, 2017 @10:23PM (#14000773)
Cool idea; bad overuse of history on website.
Re:Studio Ghibli API by ptrptr on Thursday March 30, 2017 @05:33PM (#13999074)
What is possible use case for this?
Re:Studio Ghibli API by novaleaf on Thursday March 30, 2017 @08:55PM (#14000399)
Looking at the example, they show catbus as male. Isn't it female?
Re:Studio Ghibli API by foobarrio on Thursday March 30, 2017 @09:06PM (#14000442)
Catbus has balls:

* http://i.imgur.com/gySIZ.png

Re:Studio Ghibli API by novaleaf on Thursday March 30, 2017 @09:28PM (#14000540)
I thought that was a labia, as I don't see any other male organ...
Re:Studio Ghibli API by foobarrio on Thursday March 30, 2017 @09:54PM (#14000652)
Heh heh This is a clearer picture:

* http://farm2.static.flickr.com/1258/1355972123_12a28bd3b6.jp...

Seeing that the peehole is forward would make it male no? This little toy also seems male:

* https://img0.etsystatic.com/110/0/11763563/il_570xN.88580129...

I'll be sure to ask the opinion of my friends next time I play with their cats! Btw I am not trying to argue. I'm just curious.

Re:Studio Ghibli API by novaleaf on Friday March 31, 2017 @12:05AM (#14001101)
i thought that "peehole" is a bellybutton, but yeah, maybe it's okay to be interpreted by the viewer :P
Re:Studio Ghibli API by barkingcat on Thursday March 30, 2017 @11:47AM (#13996384)
This webpage does some funky history writing on firefox and chrome on scroll, so just scrolling through the page you get dozens of fragments in your visit history. You need to click back a dozen times before you get out of the page depending on how far you scroll!
Re:Studio Ghibli API by dandelany on Thursday March 30, 2017 @11:56AM (#13996477)
Perfect use case for history.replace instead of history.push.
Re:Studio Ghibli API by SalimoS on Thursday March 30, 2017 @11:53AM (#13996438)
Even on mobile safari
Re:Studio Ghibli API by ClassyJacket on Thursday March 30, 2017 @12:05PM (#13996568)
This page hijacked my back history in some weird way. Avoid.
Re:Studio Ghibli API by phailhaus on Thursday March 30, 2017 @01:32PM (#13997273)
Nah, it's just that scrolling updates the URL the same way the sidebar links do, so it gets added to your browser history. Seems like an honest mistake.
Re:Studio Ghibli API by romanhotsiy on Friday March 31, 2017 @12:39PM (#14005515)
I'm the author of the tool used to generate the doc. And yes this is just my mistake (I don't use back button so much during testing so never noticed this). Will fix it asap.
Re:Studio Ghibli API by icebraining on Thursday March 30, 2017 @12:58PM (#13997028)
Or just use a new tab.
Re:Studio Ghibli API by fhood on Thursday March 30, 2017 @12:51PM (#13996974)
ditto
[dead]
Re:Studio Ghibli API by dang on Friday March 31, 2017 @11:54AM (#14005052)
Please don't do this here.

We detached this flagged subthread from https://news.ycombinator.com/item?id=13997270.

Re:Studio Ghibli API by bpicolo on Thursday March 30, 2017 @03:47PM (#13998336)
What's the point of being rude about this? Guy wanted to do something, and executed on it really well. Really well-laid out docs.

That's a fantastic hiring signal, unlike being a jerk on the internet.

Re:Studio Ghibli API by cholantesh on Thursday March 30, 2017 @03:56PM (#13998387)
>implying ghibli is shitty >not being a pleb

Pick one.

Re:Studio Ghibli API by johansch on Thursday March 30, 2017 @05:10PM (#13998887)
I'm not thinking Ghibli is shitty. Duh.