Categorygithub.com/jpiontek/go-ip-api
modulepackage
0.0.0-20160911175601-3b41e3a8c3b6
Repository: https://github.com/jpiontek/go-ip-api.git
Documentation: pkg.go.dev

# README

go-ip-api

A simple wrapper around the ip-api.com API for IP geolocation information written in Go (golang). Works for both the free API as well as the paid, commercial API if you have purchased a Pro license.

Usage

Import and create a new client.

import "github.com/jpiontek/go-ip-api"

client := goip.NewClient()

If you have an api key for a paid account then use

client := goip.NewClientWithApiKey("my-api-key")

Request your current public IP info.

result := client.GetLocation()

Or supply a specific IP address.

result := client.GetLocationForIp("127.0.0.1")

Keep in mind that the free account is limited to 150 requests per minute. If you exceed this limit your IP address is blacklisted from making further requests. To correct this visit this page.

##License

MIT © Jeremiah Piontek

# Functions

NewClient returns a new client.
No description provided by the author

# Constants

Pro URI.
Primary URI.

# Structs

Location contains all the relevant data for an IP.
ProClient is a commercial client for retrieving location data.
StandardClient is a free client for retreiving location data with a 150 request per minute limit.

# Interfaces

No description provided by the author