https://github.com/arimolzer/ipstack
A simple Laravel Facade package to provide ease of use when using IPStack.com to perform geolocation on IP addresses
https://github.com/arimolzer/ipstack
geolocation ipstack laravel laravel-package php8
Last synced: 5 months ago
JSON representation
A simple Laravel Facade package to provide ease of use when using IPStack.com to perform geolocation on IP addresses
- Host: GitHub
- URL: https://github.com/arimolzer/ipstack
- Owner: arimolzer
- License: other
- Created: 2025-01-30T10:41:36.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-02-12T11:08:35.000Z (12 months ago)
- Last Synced: 2025-02-12T11:46:12.677Z (12 months ago)
- Topics: geolocation, ipstack, laravel, laravel-package, php8
- Language: PHP
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Contributing: contributing.md
- License: license.md
Awesome Lists containing this project
README
# IPStack



This package has been created as a simple facade to access the [IPStack](https://ipstack.com/) API.
Take a look at [contributing.md](contributing.md) to see a to do list.
## Installation
Getting started with IPStack is easy, first install the package via Composer:
```bash
composer require arimolzer/ipstack
```
Then, optionally, publish the package configuration.
```bash
php artisan vendor:publish --provider="Arimolzer\IPStack\IPStackServiceProvider"
```
Then, you can set your environmental variables:
| Variable | Description | Default |
|----------------------------|--------------------------------------------------------------|--------------------------|
| IPSTACK_API_KEY | API Key For IP Stack | `null` |
| IPSTACK_BASE_URI | Base URL for the API | https://api.ipstack.com/ |
| IPSTACK_DEFAULT_TESTING_IP | The default IP to be used by tests for a successful response | 134.201.250.155 |
## Usage
#### Single IP Lookup
To lookup the geolocation of a single IP address:
```php
use \Arimolzer\IPStack\Facades\IPStack;
IPStack::get('134.201.250.155')
```
#### Bulk IP Address lookup
IP Stack supports bulk IP lookups, with a maximum of 50 addresses. Simply pass through an array of IP addresses to the `getBulk` method.
> [!IMPORTANT]
> The 'Professional' subscription tier is required to access the bulk endpoint.
```php
IPStack::getBulk(['134.201.250.155' ,'72.229.28.185', '110.174.165.78'])
```
## Change log
Please see the [changelog](changelog.md) for more information on what has changed recently.
## Testing
```bash
composer test
```
## Contributing
Please see [contributing.md](contributing.md) for details and a todolist.
## Security
If you discover any security related issues, please email ari.molzer@molzertech.com instead of using the issue tracker.
## Credits
- [Ari Molzer](https://github.com/arimolzer)
- [All Contributors](https://github.com/arimolzer/ipstack/graphs/contributors)
## License
MIT. Please see the [license file](license.md) for more information.