Skip to content

Instantly share code, notes, and snippets.

@bruab
Created July 31, 2015 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bruab/bfeaadb3081ff34a67f9 to your computer and use it in GitHub Desktop.
Save bruab/bfeaadb3081ff34a67f9 to your computer and use it in GitHub Desktop.
Use Python requests and telize API to get latitude and longitude for IP address
#!/usr/bin/env python
import requests
r = requests.get("http://www.telize.com/geoip/46.19.37.108")
json_object = r.json()
print(json_object['latitude'])
print(json_object['longitude'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment