![](https://camo.githubusercontent.com/d73621ce066bfe0655dea276019d7608edfc78261bc235f9532afb1b981b7db5/68747470733a2f2f6c61726176656c2e636f6d2f6173736574732f696d672f636f6d706f6e656e74732f6c6f676f2d6c61726176656c2e737667)
API's basic general documentation
GET /geolocation/:ip_address
GET /geolocation/:ip_address?service=freegeoip
GET /geolocation?service=freegeoip
GET /geolocation/:ip_address?service=ip-api
GET /geolocation?service=ip-api
Sample Requests and responses payload
{
"ip": "8.8.8.8",
"geo": {
"service": "ip-api",
"city": "Mountain View",
"region": "California",
"country": "United States"
}
}
{
"ip": "8.8.8.8",
"city": "Mountain View",
"temperature": {
"current": 13,
"low": 11,
"high": 16,
},
"wind": {
"speed": 11,
"direction": 240
}
}
API's basic technical documentation
Routes: api routes are used within this API
Controllers: Geolocation/WeatherController
app/Http/ApiControllers/GeolocationController.php
app/Http/ApiControllers/WeatherController.php
Services: Geolocation ip-api and freegeoip
app/services/IpApiService.php
app/services/IpStackService.php
Service Providers: Geolocation ip-api and freegeoip
app/providers/IpApiServiceProvider.php
app/services/IpStackServiceProvider.php
cp .env.exemple .env
-> if needed
php artisan key:generate
-> if needed
Boom! access API on localhost 127.0.0.1:8000