Getting started overview

Integrating the Loqate API involves a sequence of steps, from setting up an account and acquiring API credentials to sending your initial request and interpreting the response. This guide focuses on the Address Verification API, which is a core product for validating postal addresses globally. The process is designed to be accessible for developers looking to quickly incorporate address validation capabilities into their applications for use cases such as e-commerce checkout, CRM data cleansing, or logistics optimization.

The Loqate API operates on a usage-based model, offering a free tier for initial testing and development before transitioning to paid plans for higher volumes. Understanding the authentication mechanism, typically involving an API key, is crucial for successful integration.

Here's a quick reference table outlining the getting started process:

Step What to Do Where
1. Sign Up Create a Loqate account. Loqate homepage
2. Get API Key Locate your unique API key in the account dashboard. Loqate account dashboard
3. Review Docs Familiarize yourself with the Address Verification API reference. Loqate Address Verification API reference
4. Make Request Construct and send your first API call using your key. Your preferred HTTP client or programming environment
5. Interpret Response Parse the JSON response to confirm successful validation. Your preferred HTTP client or programming environment

Create an account and get keys

To begin using the Loqate API, you must first create an account on the official Loqate website. This account provides access to your dashboard, where you can manage your services, monitor usage, and retrieve your API key.

  1. Navigate to the Loqate website: Go to the Loqate homepage.
  2. Sign up for an account: Look for a "Sign Up" or "Get Started Free" option. You will typically need to provide an email address, create a password, and agree to the terms of service. Loqate offers a free tier that includes 100 lookups per month, suitable for initial testing.
  3. Verify your email: After signing up, you may receive an email to verify your account. Follow the instructions in the email to complete the verification process.
  4. Access your dashboard: Once verified, log in to your Loqate account.
  5. Locate your API key: Within your dashboard, there will be a section dedicated to API keys or credentials. Your unique API key will be displayed here. This key is essential for authenticating all your API requests. Keep this key secure, as it grants access to your Loqate services and lookup quota. For security best practices, consider environment variables for storing API keys in production applications, as outlined in general API security guidance by sources like Mozilla Developer Network's API key definition.

Your first request

With your Loqate API key in hand, you can now make your first address validation request. The Loqate Address Verification API uses a RESTful interface, typically returning data in JSON format. We'll use the Find service, which suggests addresses based on partial input.

The base URL for the Address Verification API is https://api.addressy.com/Capture/Interactive/Find/v1.1/json3.ws. You will need to append your API key and query parameters to this URL.

Example Request (using curl):

This example demonstrates how to find addresses starting with "10 Downing St" in the UK.

curl -X GET \
  "https://api.addressy.com/Capture/Interactive/Find/v1.1/json3.ws?Key=YOUR_API_KEY&Text=10 Downing St&Container=&Origin=&Countries=GB&Language=en-gb&Limit=10&Location=&Bias="

Replace YOUR_API_KEY with the actual API key obtained from your Loqate dashboard.

Explanation of Parameters:

  • Key: Your Loqate API key (required).
  • Text: The address text to search for (e.g., "10 Downing St").
  • Countries: A comma-separated list of country ISO 2 or 3 letter codes to limit the search (e.g., "GB" for Great Britain).
  • Language: The preferred language for results (e.g., "en-gb").
  • Limit: The maximum number of results to return.

Expected Successful Response (abbreviated JSON):

{
  "Items": [
    {
      "Id": "GB|RM|A|6775791",
      "Type": "Address",
      "Text": "10 Downing Street",
      "Highlight": "0-2,4-11,13-16",
      "Description": "Westminster, London, SW1A 2AA"
    },
    // ... other potential suggestions
  ]
}

A successful response will contain an Items array, where each item represents a found address or a component of an address. The Id field is particularly important; it is used in subsequent API calls (e.g., the Retrieve service) to get the full, parsed address details.

Common next steps

After successfully making your first Find request, several common next steps enhance your integration:

  1. Retrieve Full Address Details: Use the Id returned by the Find service with the Retrieve service to get a fully formatted and parsed address. This is crucial for applications requiring complete address data for shipping, billing, or database storage. The Loqate Address Verification API reference provides details on the Retrieve endpoint.
  2. Implement Address Capture Flow: For user-facing applications, integrate the Find and Retrieve services into an address capture workflow. This typically involves an autocomplete input field that suggests addresses as the user types, improving data accuracy and user experience.
  3. Error Handling: Implement robust error handling to gracefully manage situations such as invalid API keys, rate limits, or addresses not found. The API response will include error codes and messages for these scenarios.
  4. Explore Other Services: Depending on your needs, explore Loqate's other core products, such as email verification API or phone verification API. These can be integrated similarly to enhance data quality across multiple contact points.
  5. Monitor Usage: Regularly check your usage statistics in the Loqate dashboard to stay within your lookup quota and manage costs, especially if you are on the free tier or a usage-based plan.
  6. Client Libraries and SDKs: While Loqate does not list official SDKs in the provided entity payload, many developers create their own client wrappers or use generic HTTP client libraries in their preferred language (e.g., Python's requests, Node.js's axios) to simplify API interactions.

Troubleshooting the first call

When making your first API call, you might encounter issues. Here are common problems and their solutions:

  • Invalid API Key:
    • Symptom: API returns an error message indicating an invalid or missing key, or a 401 Unauthorized status code.
    • Solution: Double-check that you have copied your API key correctly from your Loqate dashboard. Ensure there are no leading or trailing spaces. Verify that the key is correctly passed as the Key parameter in your request URL.
  • Incorrect Endpoint or Parameters:
    • Symptom: The API returns a 404 Not Found, 400 Bad Request, or an unexpected empty response.
    • Solution: Confirm the base URL for the Find service is https://api.addressy.com/Capture/Interactive/Find/v1.1/json3.ws. Review the Loqate Address Verification API reference for the exact parameter names and expected values (e.g., Text, Countries). Parameter names are case-sensitive.
  • Network or Firewall Issues:
    • Symptom: Connection timeouts or inability to reach the API endpoint.
    • Solution: Ensure your development environment has outbound internet access. If you are behind a corporate firewall, you might need to whitelist api.addressy.com. Test connectivity using a simple ping or traceroute command to api.addressy.com.
  • Exceeded Free Tier Limits:
    • Symptom: API returns an error indicating usage limits have been reached.
    • Solution: Check your Loqate dashboard for current usage. If you've exhausted your 100 free lookups, you will need to upgrade to a paid plan or wait for your quota to reset. The Loqate pricing page details available plans.
  • JSON Parsing Errors:
    • Symptom: Your application fails to parse the API response.
    • Solution: Verify that the API is indeed returning JSON. Use a JSON linter or formatter to inspect the raw response and ensure it's well-formed. Most HTTP client libraries handle JSON parsing automatically, but issues can arise if the response is malformed or if you're trying to parse HTML/plain text as JSON.