from Hacker News

Ask HN: How do I build apps with APIs?

by venturebros on 1/20/12, 12:14 AM with 1 comments

This is the one part of Web Development so far that has me completely stumped me.

For example I go to the API section of a site. I see the url that I need to use and the parameters. I play around with it a bit in my address bar and I get the data I want. Great! But how do I take this information and build something out of it then render in html/css?

I have tried looking up tutorials and things but there seems to many different ways to go about this and it confuses me even more.

  • by Nick_C on 1/20/12, 1:53 AM

    You use whatever language you want to send an HTTP request with the parameters you want, get the data back, parse it, fiddle with it into the format you want and output the HTML. Or put it in a database for retrieval later. Or whatever you want.

    There are two distinct processes for you to implement. One is retrieving the info. Another is outputting it to your users. The simple case, albeit the slowest, is where you combine the two so that retrieving the data is done at the same time as outputting it. Or you can keep them separate by using a timer or something like cron to retrieve the info and storing it.