Skip to content
/ ipapi Public

Golang API wrapper that finds the location of an IP address using ipapi.co.

License

Notifications You must be signed in to change notification settings

fegoa89/ipapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build StatusGoDoc

IPAPI

Golang API wrapper that finds the location of an IP address using ipapi.co.

If you purchased a paid plan, export the API Key in the environment:

export IPAPI_KEY=123456asdqwe

FindLocation

Returns the complete location information for an IP address specified in the function parameter.

ipapi.FindLocation("178.13.214.11")

ClientLocation

Returns the complete location of the client (device) that’s making the request. You do not need to specify the IP address, it is inferred from the request.

ipapi.ClientLocation()

Usage

package main

import (
	"fmt"
	"github.com/fegoa89/ipapi"
)

func main() {
	// Location of a specific IP
	ipapi.FindLocation("178.13.214.11")

	// Location of client's IP
	ipapi.ClientLocation()
}

About

Golang API wrapper that finds the location of an IP address using ipapi.co.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages