tags:

views:

64

answers:

1

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

+4  A: 

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

Winston Ewert
"just a python list with dictionaries inside it". This really helped me a lot. Thanks
relima
@relima, yes and that's why JSON is so awesome.
Winston Ewert