Skip to main content
Complete reference for all IP Geolocation API endpoints, parameters, and response formats.

Base URL

https://api.sinaty.business/ip/

Endpoints Overview

MethodEndpointDescription
GET/ip/{ip_address}Get location data for a specific IP address
GET/ip/Get location data for the requesting IP address
POST/ip/Get location data via POST request with JSON body

GET /ip/

Get detailed location information for a specific IP address.

URL Parameters

ParameterTypeRequiredDescription
ip_addressstringYesThe IP address to look up (IPv4 or IPv6)

Example Request

curl "https://api.sinaty.business/ip/8.8.8.8"

Response Format

{
  "ip": "8.8.8.8",
  "timestamp": "2024-01-01T12:00:00Z",
  "api_version": "1.0",
  "country": {
    "iso_code": "US",
    "name": "United States",
    "names": {
      "en": "United States",
      "fr": "États-Unis"
    },
    "confidence": 99
  },
  "continent": {
    "code": "NA",
    "name": "North America",
    "names": {
      "en": "North America",
      "fr": "Amérique du Nord"
    }
  },
  "city": {
    "name": "Mountain View",
    "names": {
      "en": "Mountain View",
      "fr": "Mountain View"
    },
    "confidence": 90
  },
  "postal": {
    "code": "94043",
    "confidence": 85
  },
  "location": {
    "latitude": 37.4056,
    "longitude": -122.0775,
    "accuracy_radius": 1000,
    "time_zone": "America/Los_Angeles"
  },
  "subdivisions": [
    {
      "iso_code": "CA",
      "name": "California",
      "names": {
        "en": "California",
        "fr": "Californie"
      },
      "confidence": 95
    }
  ],
  "asn": {
    "autonomous_system_number": 15169,
    "autonomous_system_organization": "Google LLC"
  }
}

Response Fields

Root Level

FieldTypeDescription
ipstringThe IP address that was looked up
timestampstringISO 8601 timestamp of the request
api_versionstringCurrent API version
errorstringError message (only present on errors)

Country Information

FieldTypeDescription
country.iso_codestringTwo-letter country ISO code
country.namestringCountry name in English
country.namesobjectCountry names in multiple languages
country.confidenceintegerConfidence score (0-100)

Continent Information

FieldTypeDescription
continent.codestringTwo-letter continent code
continent.namestringContinent name in English
continent.namesobjectContinent names in multiple languages

City Information

FieldTypeDescription
city.namestringCity name in English
city.namesobjectCity names in multiple languages
city.confidenceintegerConfidence score (0-100)

Postal Information

FieldTypeDescription
postal.codestringPostal/ZIP code
postal.confidenceintegerConfidence score (0-100)

Location Information

FieldTypeDescription
location.latitudefloatLatitude coordinate
location.longitudefloatLongitude coordinate
location.accuracy_radiusintegerAccuracy radius in meters
location.time_zonestringTimezone identifier

Subdivision Information

FieldTypeDescription
subdivisions[].iso_codestringSubdivision ISO code
subdivisions[].namestringSubdivision name in English
subdivisions[].namesobjectSubdivision names in multiple languages
subdivisions[].confidenceintegerConfidence score (0-100)

ASN Information

FieldTypeDescription
asn.autonomous_system_numberintegerAutonomous System Number
asn.autonomous_system_organizationstringASN organization name

GET /ip/

Get location data for the IP address making the request.

Example Request

curl "https://api.sinaty.business/ip/"

Response Format

Same as the specific IP endpoint, but the ip field will contain the requesting IP address.

POST /ip/

Get location data via POST request with JSON body.

Request Body

{
  "ip": "8.8.8.8"
}

Example Request

curl -X POST "https://api.sinaty.business/ip/" \
  -H "Content-Type: application/json" \
  -d '{"ip": "8.8.8.8"}'

Response Format

Same as the GET endpoint.

Error Responses

Invalid IP Address (400)

{
  "error": "Invalid IP address provided",
  "status": 400,
  "timestamp": "2024-01-01T12:00:00Z"
}

Not Found (404)

{
  "error": "IP address not found in database",
  "status": 404,
  "timestamp": "2024-01-01T12:00:00Z"
}

Internal Server Error (500)

{
  "error": "Internal server error",
  "status": 500,
  "timestamp": "2024-01-01T12:00:00Z"
}

HTTP Status Codes

CodeDescription
200Success - Location data returned
400Bad Request - Invalid IP address
404Not Found - IP not in database
500Internal Server Error

Rate Limits

No rate limits! You can make unlimited requests to our API.

CORS Headers

All endpoints include the following CORS headers:
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization
Access-Control-Max-Age: 86400

Data Accuracy

Confidence Scores

  • 90-100: Very high confidence
  • 70-89: High confidence
  • 50-69: Medium confidence
  • 30-49: Low confidence
  • 0-29: Very low confidence

Accuracy Radius

The accuracy_radius field indicates the radius in meters within which the IP address is likely located. Smaller values indicate higher accuracy.

Data Availability

Not all fields may be available for every IP address:
  • Country data: Available for most IP addresses
  • City data: Available for many residential and business IPs
  • ASN data: Available for most IP addresses
  • Coordinates: Available when city data is present

Best Practices

IP Address Validation

Always validate IP addresses before sending them to the API:
function isValidIP(ip) {
  const ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
  const ipv6Regex = /^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/;
  return ipv4Regex.test(ip) || ipv6Regex.test(ip);
}

Error Handling

Always implement proper error handling:
try {
  const response = await fetch('https://api.sinaty.business/ip/8.8.8.8');
  if (!response.ok) {
    const error = await response.json();
    console.error('API Error:', error.error);
    return;
  }
  const data = await response.json();
  // Process location data
} catch (error) {
  console.error('Request failed:', error);
}

Caching

Consider caching results for frequently requested IP addresses:
const cache = new Map();

async function getLocationData(ip) {
  if (cache.has(ip)) {
    return cache.get(ip);
  }
  
  const response = await fetch(`https://api.sinaty.business/ip/${ip}`);
  const data = await response.json();
  
  cache.set(ip, data);
  return data;
}

Ready to test the API? Check out our examples for code samples in multiple programming languages.
I