Using the API.

Avatar image for tyronehoare
TyroneHoare

5

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

Hi everyone, I'm generally new to using APIs but it's required that I use one in my semester.

I'm currently attempting to integrate some features of this API into a HTML document I'm working on using Intel XDK. (I know support is down but this is what the college requires us to use)

Mainly asking if there's any basic guides that could show how I can for example, extract reviews of games or get a list of games/characters that could be put into my HTML/JS.

Thanks in advance,
Tyrone.

Avatar image for mikewhy
mikewhy

595

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#2  Edited By mikewhy

Any chance you can argue that using an already EOL'd framework is an absolute waste of time? Though I guess that is par for the course in school.

Anyways, it looks like XDK is just JavaScript. Normally you can hobble something together with "window.fetch". But GiantBomb uses JSONP, which is an older way of handling requests that doesn't work with fetch.

So it may be easier to start with jQuery using its $.get method, but again, this is avoided in the real world and schools should prepare you for that and not their bubbles. There's this project that allows you to use JSONP with a more modern fetch approach: https://github.com/camsong/fetch-jsonp

But the gist of working with any API is:

- Get an API token

- Use said token to get JSON from a URL

- Do something with the results