Using python how do I connect to two different api s at the same time so I can compare data? -


i using requests , json modules. current code looks like.

# api url connect url1 = url url2 = url  # authentication url1, url2 doesn't need auth usr = username pass = password  r2 = requests.get(url1, auth=(usr, pass), verify=false) r3 = requests.get(url2, verify=false) obj in json.loads(r2.text)['results']:     obj in json.loads(r3.text)['ip']:   if str(obj['ip']) == str(obj['ip']):          print "hostname: " + str(obj['name']) + ", ip: " + str(obj['ip']) 

what need add api mix , want run if statement compares ip addresses make sure our servers on 1 reporting system can cross reference system manually entered. can know in there or not. sorry poor example i'm on train ride home , stuck.

this question lacks details answerable. this

  • get ip addresses 1 place using requests

  • get ip addresses place using requests

  • compare python arrays, dicts, tables or whatever format got them

unless more specific information formats, tables, urls, etc. included hard give detailed help.


Comments