Skip to content

Commit d963f44

Browse files
committed
Update README.md with Lite API usage
1 parent d2c734b commit d963f44

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ You'll need an IPinfo API access token, which you can get by signing up for a fr
1414

1515
The free plan is limited to 50,000 requests per month, and doesn't include some of the data fields such as IP type and company data. To enable all the data fields and additional request volumes see [https://ipinfo.io/pricing](https://ipinfo.io/pricing?ref=lib-PHP).
1616

17-
⚠️ Note: This library does not currently support our newest free API https://ipinfo.io/lite. If you’d like to use IPinfo Lite, you can call the [endpoint directly](https://ipinfo.io/developers/lite-api) using your preferred HTTP client. Developers are also welcome to contribute support for Lite by submitting a pull request.
17+
The library also supports the Lite API, see the [Lite API section](#lite-api) for more info.
1818

1919
#### Installation
2020

@@ -233,6 +233,21 @@ $details->all;
233233
*/
234234
```
235235

236+
### Lite API
237+
238+
The library gives the possibility to use the [Lite API](https://ipinfo.io/developers/lite-api) too, authentication with your token is still required.
239+
240+
The returned details are slightly different from the Core API.
241+
242+
```php
243+
$access_token = '123456789abc';
244+
$client = new IPinfoLite($access_token);
245+
246+
$res = $client->getDetails("8.8.8.8")
247+
$res->country_code // US
248+
$res->country // United States
249+
```
250+
236251
### Caching
237252

238253
In-memory caching of `Details` data is provided by default via the [symfony/cache](https://github.com/symfony/cache/) library. LRU (least recently used) cache-invalidation functionality has been added to the default TTL (time to live). This means that values will be cached for the specified duration; if the cache's max size is reached, cache values will be invalidated as necessary, starting with the oldest cached value.

0 commit comments

Comments
 (0)