relima
relima

Reputation: 3423

Getting started with json

I have never worked with json before. I am trying: http://api.worldbank.org//topics?format=JSON and make things with it, but I don't even know how to get started.

Following some manuals, I did this:

import urllib
import urllib2
import simplejson
urlb = 'http://api.worldbank.org/topics'
datab = urllib2.urlopen(urlb+'?'+ param)
resultb = simplejson.load(datab)

but I have no clue of how to parse and work on it now, how do I list the individual items? count them? filter them?. Is there any simple tutorial that you guys can point me to or advice? I checked diveintopython, json's website and most of the obvious ones, but I am still struggling with it. Is there any simple step-by-step guide that somebody could point me to?

Thanks

Upvotes: 0

Views: 296

Answers (1)

Winston Ewert
Winston Ewert

Reputation: 45089

Trying printing resultb. Its just a python list with dictionaries inside it. Treat it like you would any list.

Upvotes: 4

Related Questions