目录
目录README.md

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)
    }
}
关于
45.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号