• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ipinfo/go: Go library for IPInfo API (IP geolocation and other types of IP data)

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

ipinfo/go

开源软件地址:

https://github.com/ipinfo/go

开源编程语言:

Go 99.0%

开源软件介绍:

IPinfo IPinfo Go Client Library

License Go Reference

This is the official Go client library for the IPinfo.io IP address API, allowing you to lookup your own IP address, or get any of the following details for other IP addresses:

  • IP to Geolocation (city, region, country, postal code, latitude and longitude)
  • IP to ASN (ISP or network operator, associated domain name, and type, such as business, hosting or company)
  • IP to Company (the name and domain of the business that uses the IP address)
  • IP to Carrier (the name of the mobile carrier and MNC and MCC for that carrier if the IP is used exclusively for mobile traffic)

Check all the data we have for your IP address here.

Getting Started

You'll need an IPinfo API access token, which you can get by singing up for a free account at https://ipinfo.io/signup.

The free plan is limited to 50,000 requests per month, and doesn't include some of the data fields such as IP type and company data. To enable all the data fields and additional request volumes see https://ipinfo.io/pricing

Installation

go get github.com/ipinfo/go/v2/ipinfo

Quick Start

package main

import (
	"fmt"
	"log"
	"net"

	"github.com/ipinfo/go/v2/ipinfo"
)

func main() {
	// Get access token by signing up a free account at https://ipinfo.io/signup
	client := ipinfo.NewClient(nil, nil, "MY_TOKEN")
	info, err := client.GetIPInfo(net.ParseIP("8.8.8.8"))
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(info)
}

Other Libraries

There are official IPinfo client libraries available for many languages including PHP, Python, Go, Java, Ruby, and many popular frameworks such as Django, Rails and Laravel. There are also many third party libraries and integrations available for our API.

About IPinfo

Founded in 2013, IPinfo prides itself on being the most reliable, accurate, and in-depth source of IP address data available anywhere. We process terabytes of data to produce our custom IP geolocation, company, carrier, VPN detection, hosted domains, and IP type data sets. Our API handles over 40 billion requests a month for 100,000 businesses and developers.

image




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap