Getting started overview

Integrating with Geocodify.com involves a sequence of steps designed to enable quick access to its geocoding, reverse geocoding, and IP geolocation services. This guide outlines the process from account creation to executing a functional API request. The fundamental requirements include obtaining an API key for authentication and understanding the basic structure of a RESTful API call with JSON responses.

Geocodify.com provides a free tier of 2,500 requests per day, allowing developers to test and integrate the API without an initial financial commitment. Paid plans are available for higher request volumes, starting at $25 per month for 100,000 requests. The API is designed to be accessible, with documentation offering examples in common programming languages such as cURL, Python, JavaScript, and PHP.

Quick reference steps

The following table summarizes the essential steps for getting started with Geocodify.com:

Step What to do Where
1. Sign Up Create a Geocodify.com account. Geocodify.com homepage
2. Get API Key Locate your unique API key in the dashboard. Geocodify.com dashboard
3. Construct Request Build your first API call, including the API key. Code editor / Terminal
4. Test Execute the request and verify the JSON response. Terminal / Browser

Create an account and get keys

Access to Geocodify.com's API services requires an API key, which authenticates your requests. The process begins with creating an account.

Account registration

  1. Navigate to the Geocodify.com homepage.
  2. Click on the "Sign Up" or "Get Started" button.
  3. Complete the registration form with your email address and a password.
  4. Verify your email address if prompted.

Upon successful registration, you will be directed to your personal dashboard.

Retrieving your API key

Your API key is a unique identifier that authorizes your API calls. It is essential to keep this key secure.

  1. Log in to your newly created Geocodify.com account.
  2. On your dashboard, locate the section labeled "API Key" or "Credentials."
  3. Copy the displayed API key. This key will be included as a query parameter in all your API requests.

For security best practices, avoid hardcoding API keys directly into client-side code or public repositories. Consider using environment variables or a secure configuration management system to store and access your API key, especially in production environments, as advised by general API security guidelines.

Your first request

After obtaining your API key, you can make your first API call. This example demonstrates a forward geocoding request, converting an address into geographic coordinates (latitude and longitude).

API endpoint structure

Geocodify.com's API is RESTful, meaning it uses standard HTTP methods (GET, POST) and returns JSON responses. The base URL for the API is https://api.geocodify.com/v2/.

For a forward geocoding request, the endpoint is typically /geocode, and the address is passed as a query parameter. The API key is also passed as a query parameter, usually named api_key.

Example: Forward geocoding request

This example uses cURL, a common command-line tool for making HTTP requests. Replace YOUR_API_KEY with the actual API key you retrieved from your dashboard.

curl "https://api.geocodify.com/v2/geocode?text=1600+Amphitheatre+Parkway,+Mountain+View,+CA&api_key=YOUR_API_KEY"

In this request:

  • https://api.geocodify.com/v2/geocode is the endpoint for forward geocoding.
  • text=1600+Amphitheatre+Parkway,+Mountain+View,+CA is the address you want to geocode, URL-encoded.
  • api_key=YOUR_API_KEY is your unique API key.

Expected JSON response

A successful request will return a JSON object containing geocoding results. The structure may vary slightly depending on the specific query and service, but it generally includes location details, confidence scores, and coordinates. This is an example of a typical response structure (actual response may contain more fields):

{
  "results": [
    {
      "address_components": {
        "city": "Mountain View",
        "state": "CA",
        "country": "USA",
        "postcode": "94043",
        "street_name": "Amphitheatre Parkway",
        "street_number": "1600"
      },
      "formatted_address": "1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA",
      "geometry": {
        "lat": 37.4224058,
        "lng": -122.0842499
      },
      "confidence": 1.0,
      "type": "street_address"
    }
  ],
  "query": {
    "text": "1600 Amphitheatre Parkway, Mountain View, CA"
  }
}

The geometry object contains the lat (latitude) and lng (longitude) values, which are the primary outputs of a forward geocoding request. The formatted_address provides a standardized representation of the input address.

Example in Python

For developers using Python, the requests library can be used to make API calls:

import requests
import json

api_key = "YOUR_API_KEY"  # Replace with your actual API key
address = "1600 Amphitheatre Parkway, Mountain View, CA"

url = f"https://api.geocodify.com/v2/geocode?text={address}&api_key={api_key}"

try:
    response = requests.get(url)
    response.raise_for_status()  # Raise an exception for HTTP errors (4xx or 5xx)
    data = response.json()
    print(json.dumps(data, indent=2))

    if data and data.get("results"):
        first_result = data["results"][0]
        print(f"Latitude: {first_result['geometry']['lat']}")
        print(f"Longitude: {first_result['geometry']['lng']}")
    else:
        print("No geocoding results found.")

except requests.exceptions.RequestException as e:
    print(f"An error occurred: {e}")
except json.JSONDecodeError:
    print(f"Failed to decode JSON response: {response.text}")

Common next steps

After successfully making your first request, consider these common next steps to further integrate Geocodify.com into your application:

  • Explore other API endpoints: Geocodify.com offers reverse geocoding (coordinates to address) and IP geolocation (IP to location). Experiment with these to understand their capabilities.
  • Implement error handling: Integrate robust error handling into your code to manage API limits, invalid inputs, and other potential issues. The API returns standard HTTP status codes (e.g., 400 for bad request, 403 for forbidden, 429 for too many requests) and JSON error messages.
  • Batch geocoding: For processing multiple addresses efficiently, explore Geocodify.com's batch geocoding functionality. This can significantly reduce the number of individual API calls required.
  • Monitor usage: Keep track of your API usage through your Geocodify.com dashboard to stay within your free tier limits or monitor your paid plan consumption.
  • Secure your API key: Ensure your API key is stored and transmitted securely. For server-side applications, use environment variables. For client-side applications, consider proxying requests through your own backend to hide the key.
  • Review documentation: Refer to the official Geocodify.com documentation for advanced features, specific parameter details, and best practices.

Troubleshooting the first call

When the first API call doesn't work as expected, several common issues can be addressed:

Common error codes and solutions

  • 400 Bad Request: This typically indicates an issue with your request parameters.
    • Solution: Double-check the text parameter for proper URL encoding and ensure all required parameters are present. Consult the API reference for correct parameter usage.
  • 401 Unauthorized / 403 Forbidden: These errors usually point to an authentication problem.
    • Solution: Verify that your api_key parameter is correctly included in the URL and that the key itself is accurate and active. Ensure there are no leading or trailing spaces.
  • 404 Not Found: This means the requested endpoint does not exist.
    • Solution: Confirm the base URL (https://api.geocodify.com/v2/) and the specific endpoint (e.g., /geocode) are correctly spelled and match the documentation.
  • 429 Too Many Requests: You have exceeded your daily or hourly request limit.
    • Solution: Wait for the rate limit to reset, or consider upgrading your plan if you consistently hit this limit. You can monitor your usage in the Geocodify.com dashboard.
  • 5xx Server Error: These indicate an issue on Geocodify.com's server.
    • Solution: These are usually temporary. Wait a few minutes and retry the request. If the issue persists, check the Geocodify.com status page (if available) or contact their support.

General troubleshooting tips

  • Check API Key: Ensure the API key copied from your dashboard is exactly what you are using in your request. Even minor discrepancies can cause authentication failures.
  • URL Encoding: Make sure any special characters in your address string (e.g., spaces, commas, #) are properly URL-encoded. Tools like curl often handle this automatically for simple GET requests, but manual encoding might be needed for complex parameters or other clients.
  • Network Connectivity: Verify that your development environment has active internet access and is not blocked by a firewall from reaching api.geocodify.com.
  • Review Documentation: The Geocodify.com API documentation is the authoritative source for endpoint specifics, required parameters, and expected response formats. Cross-reference your request against the examples provided.
  • Use a REST Client: Tools like Postman or Insomnia can help construct and test API requests more easily, providing clear visibility into request headers, parameters, and responses.