Skip to content

Commit 3bc80b6

Browse files
committed
Update README.md
1 parent 83cefd2 commit 3bc80b6

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

README.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ You'll need an IPinfo API access token, which you can get by signing up for a fr
1919

2020
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).
2121

22-
⚠️ 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.
22+
The library also supports the Lite API, see the [Lite API section](#lite-api) for more info.
2323

2424
## Installation
2525

@@ -60,7 +60,7 @@ Add this line to your application's `rebar.config`:
6060
#{<<"code">> => <<"AF">>,<<"name">> => <<"Africa">>},
6161
<<"ID">> =>
6262
#{<<"code">> => <<"AS">>,<<"name">> => <<"Asia">>},
63-
<<"QA">> =>
63+
<<"QA">> =>
6464
#{<<"code">> => <<"AS">>,<<"name">> => <<"Asia">>},
6565
<<"LC">> =>
6666
#{<<"code">> => <<"NA">>,<<"name">> => <<"North America">>},
@@ -166,7 +166,7 @@ Add this line to your application's `rebar.config`:
166166
<<"unicode">> => <<"U+1F1F5 U+1F1EB">>},
167167
<<"CV">> =>
168168
#{<<"emoji">> => <<240,159,135,168,240,159,135,187>>,
169-
<<"unicode">> => <<"U+1F1E8 U+1F1FB">>},
169+
<<"unicode">> => <<"U+1F1E8 U+1F1FB">>},
170170
<<"CG">> =>
171171
#{<<"emoji">> => <<240,159,135,168,240,159,135,172>>,
172172
<<"unicode">> => <<"U+1F1E8 U+1F1EC">>},
@@ -240,7 +240,7 @@ Add this line to your application's `rebar.config`:
240240
#{<<"emoji">> => <<240,159,135,191,240,159,135,178>>,
241241
<<"unicode">> => <<"U+1F1FF U+1F1F2">>},...},
242242
country_flag_base_url =>
243-
<<"https://cdn.ipinfo.io/static/images/countries-flags/">>,
243+
<<"https://cdn.ipinfo.io/static/images/countries-flags/">>,
244244
eu_countries =>
245245
[<<"IE">>,<<"AT">>,<<"LT">>,<<"LU">>,<<"LV">>,<<"DE">>,
246246
<<"DK">>,<<"SE">>,<<"SI">>,<<"SK">>,<<"CZ">>,<<"CY">>,
@@ -315,6 +315,23 @@ def current_ip() do
315315
end
316316
```
317317

318+
## Lite API
319+
320+
The library gives the possibility to use the [Lite API](https://ipinfo.io/developers/lite-api) too, authentication with your token is still required.
321+
322+
The returned details are slightly different from the Core API.
323+
324+
```erlang
325+
Token = <<"TOKEN">>.
326+
{ok, IpInfoLite} = ipinfo_lite:create(Token).
327+
{ok, #{
328+
<<"country_code">> := CountryCode,
329+
<<"country">> := Country
330+
} } = ipinfo_lite:details(IpInfoLite, <<"8.8.8.8">>).
331+
io:format(CountryCode). %% US
332+
io:format(Country). %% United States
333+
```
334+
318335
## Other Libraries
319336

320337
There are official [IPinfo client libraries](https://ipinfo.io/developers/libraries) available for many languages including PHP, Go, Java, Ruby, and many popular frameworks such as Django, Rails, and Laravel. There are also many third-party libraries and integrations available for our API.

0 commit comments

Comments
 (0)