Information from the run DB can be obtained using json. The following expample shows it for runs. Similar interfaces exist for fills as well.

rundb.py
import urllib, json
runDBEntry = json.loads( urllib.urlopen("http://lbrundb.cern.ch/api/run/"+str(run)+"/").read())