https://github.com/daandesmedt/freegeoip-php-wrapper
PHP wrapper for the FreeGeoIp Geolocation API
https://github.com/daandesmedt/freegeoip-php-wrapper
Last synced: 3 months ago
JSON representation
PHP wrapper for the FreeGeoIp Geolocation API
- Host: GitHub
- URL: https://github.com/daandesmedt/freegeoip-php-wrapper
- Owner: DaanDeSmedt
- Created: 2017-03-29T11:32:21.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-10-29T08:22:05.000Z (over 4 years ago)
- Last Synced: 2025-01-11T18:29:02.730Z (5 months ago)
- Language: PHP
- Homepage: https://freegeoip.net
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
PHP wrapper for the FreeGeoIp Geolocation API
=======Basic PHP wrapper for the [FreeGeoIp Geolocation API] (https://freegeoip.app/)
### Installation
Download and include in your project.
Not listed on Composer.### Methods
#### Get GEO info by IP
Use `->fetch($ip)` to retrieve GEO information from specified IP.### API usage limits
You're allowed up to 15,000 queries per hour by default. Once this limit is reached, all of your requests will result in HTTP 403, forbidden, until your quota is cleared.### Usage
```php
// json
$ipInfoJSON = new FreeGeoIp('json');
var_dump($ipInfoJSON->fetch('194.78.226.199'));// xml
$ipInfoXML = new FreeGeoIp('xml');
var_dump($ipInfoXML->fetch('194.78.226.199'));// csv
$ipInfoCSV = new FreeGeoIp('csv');
var_dump($ipInfoCSV->fetch('194.78.226.199'));
```#### Formats supported
`json`
`xml`
`csv`