IPData

1.0.0

Swift library to gather information for an IP using ipdata.co
heyzooi/ipdata

What's New

1.0.0

2018-10-30T06:50:51Z

First Release

IPData

Swift library to gather information for an IP using https://ipdata.co

Getting Started

Setting your API Key

IPData.apiKey = "test"

or adding the apiKey parameter in each call

IPData.lookup(apiKey: "test") {
    switch $0 {
    case .success(let ip):
        print(ip)
    case .failure(let error):
        print(error)
    }
}

Looking up your own IP

IPData.lookup {
    switch $0 {
    case .success(let ip):
        print(ip)
    case .failure(let error):
        print(error)
    }
}

Looking up a specific IP address (IPv4 or IPv6 address)

IPData.lookup(ip: "66.102.160.1") {
    switch $0 {
    case .success(let ip):
        print(ip)
    case .failure(let error):
        print(error)
    }
}

Bulk Lookup

IPData.lookup(bulk: ["66.102.160.1", "100.128.0.9"]) {
    switch $0 {
    case .success(let ip):
        print(ip)
    case .failure(let error):
        print(error)
    }
}

Carrier Lookup

IPData.carrier(ip: "66.102.160.1") {
    switch $0 {
    case .success(let ip):
        print(ip)
    case .failure(let error):
        print(error)
    }
}

Description

  • Swift Tools 4.2.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sat Oct 19 2024 23:49:45 GMT-0900 (Hawaii-Aleutian Daylight Time)