Skip to main content

Point-in-Area Check

Check whether GPS coordinates fall within a specific country or subdivision. Returns a simple boolean (true or false).

Check Country

GET /geo/country/{countryCode}/isInCountry?latitude={lat}&longitude={lon}

Parameters

ParameterTypeLocationDescription
countryCodestringpathISO 3166-1 alpha-3 code (e.g., USA for United States, BRA for Brazil)
latitudenumberqueryLatitude coordinate (-90 to 90)
longitudenumberqueryLongitude coordinate (-180 to 180)

Examples

# Is New York in the USA (USA)?
curl "https://api.boxesnlines.com/geo/country/USA/isInCountry?latitude=40.7128&longitude=-74.0060" \
-H "X-API-Key: YOUR_API_KEY"
# Response: true

# Is New York in Brazil (BRA)?
curl "https://api.boxesnlines.com/geo/country/BRA/isInCountry?latitude=40.7128&longitude=-74.0060" \
-H "X-API-Key: YOUR_API_KEY"
# Response: false
const response = await fetch(
"https://api.boxesnlines.com/geo/country/USA/isInCountry?latitude=40.7128&longitude=-74.0060",
{ headers: { "X-API-Key": "YOUR_API_KEY" } }
);

const isInCountry = await response.text();
console.log(isInCountry); // "true"

Check Subdivision

GET /geo/subdivision/{subdivisionCode}/isInSubdivision?latitude={lat}&longitude={lon}

Parameters

ParameterTypeLocationDescription
subdivisionCodestringpathISO 3166-2 code (e.g., US-NY, BR-SP)
latitudenumberqueryLatitude coordinate (-90 to 90)
longitudenumberqueryLongitude coordinate (-180 to 180)

Examples

# Is this point in New York?
curl "https://api.boxesnlines.com/geo/subdivision/US-NY/isInSubdivision?latitude=40.7128&longitude=-74.0060" \
-H "X-API-Key: YOUR_API_KEY"
# Response: true

# Is this point in California?
curl "https://api.boxesnlines.com/geo/subdivision/US-CA/isInSubdivision?latitude=40.7128&longitude=-74.0060" \
-H "X-API-Key: YOUR_API_KEY"
# Response: false

Use Cases

  • Geo-fencing: Verify a user is within a specific region before granting access
  • Regulatory compliance: Confirm users are in permitted jurisdictions
  • Content restrictions: Enforce geographic content licensing
  • Delivery zones: Check if a location is within a service area

Try It

Use the interactive API reference to test these endpoints with your own API key.