Geo API

FonProxy Geo API reference documentation.

FonProxy API — Geo Counts

Public endpoints for available proxy country counts.


Get Counts

GET /geo/counts

Public — returns available proxy IP counts per country (with multipliers applied). Response is nested by proxy type → pool → service → country code.

Query parameters:

ParamTypeDefaultDescription
typestringallFilter by proxy type (e.g. residential-giga)
poolstringallFilter by pool (e.g. default)
noservicebooleanfalseOnly default service, collapses service layer

Response (200) — default (with service):

{
  "counts": {
    "residential-giga": {
      "default": {
        "provider-api": {
          "US": 1200000,
          "GB": 350000,
          "DE": 420000
        }
      }
    },
    "server-static": {
      "default": {
        "geoip": {
          "US": 150,
          "DE": 80
        },
        "maxmind": {
          "US": 148,
          "DE": 79
        }
      }
    }
  }
}

Structure: counts[proxyTypeId][pool][service][countryCode] = count

Response (200) — with ?noservice=true:

{
  "counts": {
    "residential-giga": {
      "default": {
        "US": 1200000,
        "GB": 350000,
        "DE": 420000
      }
    },
    "server-static": {
      "default": {
        "US": 150,
        "DE": 80
      }
    }
  }
}

Structure: counts[proxyTypeId][pool][countryCode] = count


Get Countries

GET /geo/countries?type=residential-giga

Public — returns available country codes for a proxy type.

Query parameters:

ParamTypeRequiredDescription
typestringyesProxy type ID
poolstringnoPool name (default: default)

Response (200):

{
  "countries": ["AE", "AR", "AU", "BR", "CA", "DE", "FR", "GB", "IN", "JP", "US"]
}

Data Sources

Proxy TypeLoaderSource
residential-gigaResidentialGeoCountLoaderProvider API (dummy for now)
mobile-giga(future)Provider API
datacenter-giga(future)Provider API
server-staticIpCountLoader (DB)static_ips table, grouped by geo service
private-proxyIpCountLoader (DB)static_ips table, grouped by geo service
shared-proxyIpCountLoader (DB)static_ips table, grouped by geo service

Priority: Loaders provide base data (low priority), multipliers adjust the output (high priority).

How It Works

  1. Loaders fetch raw IP counts — from provider APIs or the static_ips DB
  2. Counts are cached in-memory, refreshed every 10 minutes
  3. Admin configures multipliers per type/pool/country to adjust public-facing numbers
  4. Public endpoints apply multipliers on top of raw loader data
  5. countryCode = '*' multiplier applies to all countries for that type+pool
  6. Internal service provides raw counts (no multipliers) for order provisioning
Geo API — FonProxy