Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/fairytale5571/go-ip-api

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/fairytale5571/go-ip-api

  • v0.0.0-20210718002603-1cfa9347e1db
  • Source
  • Go
  • Socket score

Version published
Created
Source

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

FAQs

Package last updated on 18 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc