Skip to main content

Best Free Rest API for IP-based user location detection

Project description

GeoIP

Best Free Rest API for IP-based user location detection.

97.5% IPv4 and IPv6 address coverage in our database with daily updates. Median data retrieval from the DB is 0.002 seconds.

More info and an absolutely free API Key: https://surfy.one/geoip

Installation

pip install Surfy.GeoIP

Usage

from geoip import GeoIP

lookup = GeoIP("email@example.com", "YOUR_FREE_API_KEY")
# Get a Free API Key > https://surfy.one/geoip

testIPs = ["8.8.8.8", "2a01:e35:8bd9:8bb0:92b:8628:5ca5:5f2b"];

results = []
for IP in testIPs:
	result = lookup.get(IP)
	results.append(result)

print(results)

'''

Results [
  {
    ip: '8.8.8.8',
    code: 'US',
    country: 'United States of America',
    region: 'California',
    city: 'Mountain View',
    latitude: 37.405992,
    longitude: -122.078515,
    zip: '94043',
    timezone: '-07:00',
    state: true
  },
  {
    ip: '2a01:e35:8bd9:8bb0:92b:8628:5ca5:5f2b',
    code: 'FR',
    country: 'France',
    region: 'Ile-de-France',
    city: 'Paris',
    latitude: 48.858365,
    longitude: 2.294532,
    zip: '75000',
    timezone: '+01:00',
    state: true
  }
]

'''


MIT License

Copyright (c) Alexander Yermolenko • surfy.one

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Surfy.GeoIP-1.0.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Surfy.GeoIP-1.0.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file Surfy.GeoIP-1.0.0.tar.gz.

File metadata

  • Download URL: Surfy.GeoIP-1.0.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.6

File hashes

Hashes for Surfy.GeoIP-1.0.0.tar.gz
Algorithm Hash digest
SHA256 deb156d37b8cee897320180b8c5c41296be55ff53ce77ab20db146c7e4c9d788
MD5 3c98a4c8f96ecc9e464b6916c26e6d65
BLAKE2b-256 5d5788f6f73ac0fbdd878dbd8135603f272965460f628b5e172eedc79d9e788d

See more details on using hashes here.

File details

Details for the file Surfy.GeoIP-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: Surfy.GeoIP-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.6

File hashes

Hashes for Surfy.GeoIP-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9ba4b6980bb542de22742ad360ed2e8e788d67d92f11a0f12689d2d078b9df6
MD5 0c13d0a1e273edc0ff837a629c6f8bd7
BLAKE2b-256 f12e5dc31d82d78fbe475f58dbbbc87378ccdc340dd7b9531cd7cda611ca7970

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page