https://github.com/defkode/ipinfodb
ipinfodb api
https://github.com/defkode/ipinfodb
Last synced: 9 months ago
JSON representation
ipinfodb api
- Host: GitHub
- URL: https://github.com/defkode/ipinfodb
- Owner: defkode
- License: mit
- Created: 2011-01-18T14:55:20.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2013-10-30T15:31:51.000Z (over 12 years ago)
- Last Synced: 2025-10-13T04:07:36.626Z (9 months ago)
- Language: Ruby
- Homepage: http://ipinfodb.com
- Size: 106 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ipinfodb
Ruby gem for IP address geolocation via API calls to [IPInfoDB.com](http://ipinfodb.com/).
## Installation
```
gem install ipinfodb
```
## Usage
```ruby
Ipinfodb.api_key = "your_api_key_here"
Ipinfodb.lookup('153.19.48.1')
```
You will receive the following `Hash` as a response (for successful lookups):
```ruby
{
"statusCode" : "OK",
"statusMessage" : "",
"ipAddress" : "153.19.48.1",
"countryCode" : "PL",
"countryName" : "POLAND"
}
```
## Running tests
```
IPINFODB_API_KEY= rake test
```
Copyright © 2011-2013 Tomasz Mazur, released under the MIT license