Getting started overview

Getting started with IP Vigilante involves a direct process focused on obtaining an API key and executing HTTP GET requests. The API is designed for developers requiring basic IP geolocation data, such as country, city, and continent, for personal projects or smaller applications. The primary interaction method is through standard web requests, with responses provided in JSON format.

The following table outlines the key steps to begin using the IP Vigilante API:

Step What to Do Where
1. Account Creation Register for a free account. IP Vigilante website
2. API Key Retrieval Locate your unique API key in your account dashboard. IP Vigilante account dashboard
3. Construct Request Formulate an HTTP GET request to the API endpoint with your API key. Code editor or terminal
4. Execute Request Send the HTTP GET request. Code editor or terminal
5. Parse Response Process the JSON response to extract geolocation data. Code editor

Create an account and get keys

To access the IP Vigilante API, you must first create an account on their official website. The registration process is designed to be straightforward, requiring a valid email address and the creation of a password. Upon successful registration, a unique API key is automatically generated and associated with your account. This key is crucial for authenticating all your API requests.

  1. Navigate to the IP Vigilante Website: Open your web browser and go to the IP Vigilante homepage.
  2. Initiate Signup: Look for a 'Sign Up' or 'Get Started' button, typically located in the navigation bar or prominent on the landing page.
  3. Complete Registration Form: Provide the requested information, which usually includes your email address and a password. You may also be asked to agree to terms of service.
  4. Verify Email (if required): Some services require email verification to activate your account. Check your inbox for a confirmation email and follow the instructions.
  5. Access Dashboard: Once registered and logged in, you will be directed to your account dashboard.
  6. Retrieve API Key: Within your dashboard, locate the section dedicated to API keys or credentials. Your unique API key will be displayed there. It is recommended to copy this key and store it securely, as it grants access to your API usage. The IP Vigilante documentation provides further details on managing your API key.

IP Vigilante offers a free tier that includes 10,000 requests per month, which is automatically available upon account creation. For higher volumes, paid plans start at $10 per month for 500,000 requests, as detailed on their pricing page.

Your first request

After obtaining your API key, you can make your first API request to retrieve geolocation data for an IP address. The IP Vigilante API uses a simple RESTful interface, accepting HTTP GET requests and returning data in JSON format. No specific SDKs are officially provided, so direct HTTP requests are the standard method.

API Endpoint Structure

The base URL for the IP Vigilante API is https://ipvigilante.com/json/. To query a specific IP address, you append the IP address to this base URL.

Constructing the Request

The API key is passed as a query parameter named key. A typical request URL will look like this:

https://ipvigilante.com/json/{IP_ADDRESS}?key={YOUR_API_KEY}

Replace {IP_ADDRESS} with the IP address you wish to query (e.g., 8.8.8.8 for Google's public DNS) and {YOUR_API_KEY} with the API key you retrieved from your dashboard.

Example using curl

You can test your first request using a command-line tool like curl. Replace YOUR_API_KEY with your actual API key.

curl "https://ipvigilante.com/json/8.8.8.8?key=YOUR_API_KEY"

Example using Python

For programmatic access, you can use a language like Python with its requests library. First, ensure you have the requests library installed (pip install requests).

import requests
import json

api_key = "YOUR_API_KEY"  # Replace with your actual API key
ip_address = "8.8.8.8"

url = f"https://ipvigilante.com/json/{ip_address}?key={api_key}"

try:
    response = requests.get(url)
    response.raise_for_status()  # Raise an HTTPError for bad responses (4xx or 5xx)
    data = response.json()
    print(json.dumps(data, indent=2))
except requests.exceptions.HTTPError as http_err:
    print(f"HTTP error occurred: {http_err}")
except Exception as err:
    print(f"An error occurred: {err}")

Example JSON Response

A successful request will return a JSON object containing geolocation details. The structure typically includes fields like status, data, and various location attributes.

{
  "status": "success",
  "data": {
    "ipv4": "8.8.8.8",
    "continent_name": "North America",
    "country_name": "United States",
    "subdivision_1_name": "California",
    "city_name": "Mountain View",
    "latitude": "37.38600",
    "longitude": "-122.08380"
  }
}

This response structure is consistent, providing a predictable format for parsing in your applications. For detailed field descriptions, refer to the IP Vigilante API documentation.

Common next steps

Once you have successfully made your first API call, you can integrate IP Vigilante into your applications. Common next steps often involve:

  • Error Handling: Implement robust error handling to manage cases where the API returns an error status (e.g., invalid API key, rate limit exceeded, or invalid IP address). HTTP status codes and API-specific error messages can guide your error handling logic. The HTTP 401 Unauthorized status code, for example, often indicates an issue with the API key, as documented by Mozilla Developer Network on HTTP status codes.
  • Rate Limiting Management: Understand the rate limits applicable to your account tier. For the free tier, this is 10,000 requests per month. Implement mechanisms such as caching IP lookup results or using exponential backoff for retries to stay within these limits and avoid service disruptions.
  • Data Storage and Caching: For frequently requested IP addresses, consider caching the geolocation data locally to reduce API calls and improve application performance. This is particularly useful for static content or user sessions.
  • Integration into Applications: Integrate the API call into your application's logic. This could be for personalizing content based on a user's country, displaying local time, or restricting access based on geographical location.
  • Monitoring Usage: Regularly check your API usage against your plan limits via your IP Vigilante dashboard to prevent unexpected service interruptions or overage charges.
  • Exploring Advanced Features (if applicable): While IP Vigilante focuses on basic lookups, review the documentation for any additional parameters or endpoints that might offer more specific data or filtering options relevant to your use case.

Troubleshooting the first call

If your first API call does not return the expected JSON response, consider the following troubleshooting steps:

  1. Verify API Key: Double-check that the API key in your request exactly matches the key displayed in your IP Vigilante dashboard. Typos or extra spaces can lead to authentication failures.
  2. Check IP Address Format: Ensure the IP address you are querying is valid and correctly formatted (e.g., 8.8.8.8, not google.com). The API expects a valid IPv4 or IPv6 address.
  3. Review Request URL: Confirm that the URL is correctly constructed, with https://, the correct base domain, the /json/ path, the IP address, and the ?key= parameter.
  4. Internet Connectivity: Verify that your environment has stable internet connectivity to reach the IP Vigilante servers.
  5. Firewall or Proxy Issues: If you are making requests from a corporate network, a firewall or proxy server might be blocking outgoing HTTP requests to external APIs. Consult with your network administrator if you suspect this is the case.
  6. Check API Status Page: Occasionally, API services may experience outages. Check the IP Vigilante website or any provided status page for service announcements.
  7. Examine HTTP Response Codes: Analyze the HTTP status code returned with the response. Common codes to look for include:
    • 200 OK: Success, but check the JSON body for potential API-specific errors (e.g., "status": "error").
    • 400 Bad Request: Often indicates an issue with the request parameters or format.
    • 401 Unauthorized: Typically means the API key is missing or invalid.
    • 403 Forbidden: Could indicate rate limit exceeded or insufficient permissions.
    • 404 Not Found: The endpoint URL might be incorrect.
    • 5xx Server Error: Indicates an issue on the IP Vigilante server side.
  8. Consult Documentation: Refer to the IP Vigilante documentation for specific error codes or troubleshooting guides.