# API

**URL:** https://community.ipinfo.io/c/docs/api/9.md

[Latest](https://community.ipinfo.io/latest.md) · [Categories](https://community.ipinfo.io/categories.md) · [Tags](https://community.ipinfo.io/tags.md)

---

## [About the API category](https://community.ipinfo.io/t/about-the-api-category/21)

<div class="topic-metadata">

**Author:** [@Abdullah](https://community.ipinfo.io/u/Abdullah)\
**Replies:** 0

</div>

Technical documentation and general resources about our API services

---

## [Getting all prefixes or parent ranges (IPv4 and IPv6) from the ASN API using JQ](https://community.ipinfo.io/t/getting-all-prefixes-or-parent-ranges-ipv4-and-ipv6-from-the-asn-api-using-jq/5535)

<div class="topic-metadata">

**Author:** [@Abdullah](https://community.ipinfo.io/u/Abdullah)\
**Replies:** 0\
**Last updated:** [March 1, 2024, 6:09pm UTC](https://community.ipinfo.io/t/getting-all-prefixes-or-parent-ranges-ipv4-and-ipv6-from-the-asn-api-using-jq/5535 "2024-03-01T18:09:20Z")

</div>

This works for the ASN API. :link: ASN API - Documentation curl -sL ipinfo.io/AS62240?token=$token | jq -r '.prefixes\[\].netblock, .prefixes6\[\].netblock' curl is used for making the get request. -sL is not necess…

---

## [Getting the country code of an IP addressing using IPinfo and jQuery](https://community.ipinfo.io/t/getting-the-country-code-of-an-ip-addressing-using-ipinfo-and-jquery/44)

<div class="topic-metadata">

**Author:** [@Abdullah](https://community.ipinfo.io/u/Abdullah)\
**Replies:** 0\
**Last updated:** [March 27, 2023, 11:46am UTC](https://community.ipinfo.io/t/getting-the-country-code-of-an-ip-addressing-using-ipinfo-and-jquery/44 "2023-03-27T11:46:03Z")

</div>

Making an API call and extracting the Country Code You can make an API request to IPinfo.io and extract the country value (E.G - US) from the response payload like so: jQuery.ajax({ // remember to add the Token …

---

## [Securing your IPinfo token on the frontend](https://community.ipinfo.io/t/securing-your-ipinfo-token-on-the-frontend/35)

<div class="topic-metadata">

**Author:** [@Abdullah](https://community.ipinfo.io/u/Abdullah)\
**Replies:** 0\
**Last updated:** [March 27, 2023, 7:52am UTC](https://community.ipinfo.io/t/securing-your-ipinfo-token-on-the-frontend/35 "2023-03-27T07:52:16Z")

</div>

We recommend users put their IPinfo token in their backend or server-side because of security reasons, but for many instances, you might need to make the IPinfo API call from the frontend such as — web personalization, l…
