Coder Social home page Coder Social logo

ipkit's Introduction

๐ŸŒ IPKit

Travis Status GitHub GitHub release

IPKit is an easy-to-use framework for iOS/macOS that lets you interface seamlessly with ipapi.co, a commonly used service to obtain your IP address and some useful data related to it. With IPKit, you can go from this...

curl https://ipapi.co/8.8.8.8/json/
{
    "ip": "8.8.8.8",
    "city": "Mountain View",
    "region": "California",
    "region_code": "CA",
    "country": "US",
    "country_name": "United States",
    "continent_code": "NA",
    "in_eu": false,
    "postal": "94035",
    "latitude": 37.386,
    "longitude": -122.0838,
    "timezone": "America/Los_Angeles",
    "utc_offset": "-0800",
    "country_calling_code": "+1",
    "currency": "USD",
    "languages": "en-US,es-US,haw",
    "asn": "AS15169",
    "org": "Google LLC"
}

... to this Swift beauty:

IPAPI.shared.fetch { (response, error) in
    let ipAddress   = response.ip                   // "8.8.8.8"
    let city        = response.location.city        // "Mountain View"
    let coordinates = response.location.coordinates // CLLocationCoordinate2D(37.386, -122.0838)
}

ipkit's People

Contributors

agottardo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ipkit's Issues

Add more APIs as backup

Might be a good idea to provide support for additional services, like:

  • ipapi.co
  • ip-api.com
  • ipapi.com
  • ipify.org
  • ipgeolocation.io

This likely requires implementing an IPProvider protocol.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.