API Documentation

Overview

This documentation is intended for developers who want to write applications that can query apip.cc.
We serve our data in json formats via a simple URL-based interface over HTTPS, which enables you to use our data directly from your browser.

Format:

API JSON

URL: https://apip.cc/json
Function: Get your IP info
Example: https://apip.cc/json

URL: https://apip.cc/api-json/{ip-or-domain}
Function: Get any IP info
Example: https://apip.cc/api-json/8.8.8.8


Response https://apip.cc/json



API Rates

Format:

URL: https://apip.cc/api-rates/{amount}-{base}2{target}
Function: Currency Converter
Example: https://apip.cc/api-rates/10-gbp2usd

Supported base and target currency codes:

usd eur gbp btc aed afn all amd ang aoa ars aud awg azn bam bbd bdt bgn bhd bif bmd bnd bob brl bsd btn bwp byn bzd cad cdf chf clf clp cnh cny cop crc cuc cup cve czk djf dkk dop dzd egp ern etb fjd fkp gel ggp ghs gip gmd gnf gtq gyd hkd hnl hrk htg huf idr ils imp inr iqd irr isk jep jmd jod jpy kes kgs khr kmf kpw krw kwd kyd kzt lak lbp lkr lrd lsl lyd mad mdl mga mkd mmk mnt mop mru mur mvr mwk mxn myr mzn nad ngn nio nok npr nzd omr pab pen pgk php pkr pln pyg qar ron rsd rub rwf sar sbd scr sdg sek sgd shp sll sos srd ssp std stn svc syp szl thb tjs tmt tnd top try ttd twd tzs uah ugx uyu uzs ves vnd vuv wst xaf xag xau xcd xdr xof xpd xpf xpt yer zar zmw zwl

API Logs

By default, we enable the logging feature when our API system is loaded via the HTTPS protocol and there is a referrer URL. Regardless of whether a referrer URL is present or not, our API will continue to function as expected.

If you wish to disable this logging feature, please use the URL https://apip.cc/json?nolog. Note that we consider www and non-www as different. If you have just started using your API, please wait up to 5 minutes or until our API has been loaded several times on your website.
Note: API Logs feature is only available for the URL https://apip.cc/json

To view your API logs, please click here.

Usage limits

This API is limited to 5 requests per second from an IP address.

Custom Domain

If you would like to use your own domain or sub-domain (e.g., json.example.com or json.example.com/api-json/ip-address), please contact us. To enable this feature, a donation is required. This helps us reduce spam and improve our services. Please note that rate limits and API logs will still apply.

Benefits of a Custom Domain:

  1. Professional Appearance: Enhance your website’s professional look and credibility.
  2. Custom CORS Settings: Configure Cross-Origin Resource Sharing (CORS) to restrict your API to be loaded only on specified websites.
  3. Custom Browser Cache Duration: Define the browser cache duration according to your needs; the default is 1 hour.
  4. Increased Rate Limit: Raise the rate limit from 5 requests per second to 10 requests per second; contact us if you require a higher limit.
  5. Ad Blocker Avoidance: Prevent your API from being blocked by ad blockers, script blockers, and similar tools.
  6. Support Our Services: Help us improve and offer better services.

Use cases

- How to Redirect Visitors by Country Using JavaScript

- How to Redirect Visitors Based on Continent Using JavaScript

- Display Different Banner Based on Visitor Country Using JavaScript

- Display Different Banners Based on Visitor's Continent Using JavaScript