SDKs overview
Loqate provides software development kits (SDKs) and client libraries designed to streamline the integration of its address, email, and phone verification services into various applications. These SDKs abstract the underlying RESTful API calls, allowing developers to interact with Loqate's services using native language constructs rather than raw HTTP requests and JSON parsing. The primary goal of these libraries is to simplify common tasks such as address autocomplete, validation, and data enrichment, thereby reducing development time and potential integration errors. The SDKs are generally structured to support the core products, including address verification, email verification, phone verification, and geolocation APIs, by offering methods that map directly to API endpoints. Developers can select an SDK based on their preferred programming language or development environment, with official support typically available for popular web and backend languages. For instance, a JavaScript SDK might be used for real-time address validation during an e-commerce checkout process, while a Python or Java SDK could be utilized for bulk address cleansing in a backend system. The availability of these tools helps ensure that developers can implement Loqate's functionality efficiently across different platforms and application architectures.
Integrating with APIs often involves managing authentication, constructing request bodies, and parsing responses. SDKs handle these complexities, providing a higher-level interface. This approach is common among API providers to improve developer experience, as noted in general API design principles outlined by organizations like the World Wide Web Consortium (W3C) regarding web service standards. Loqate's SDKs follow this pattern, aiming to make its address data services accessible to a broad developer audience.
Official SDKs by language
Loqate maintains official SDKs for several programming languages, each designed to provide a native interface for interacting with its APIs. These SDKs are developed and supported by Loqate, ensuring compatibility with the latest API versions and features. They typically include components for address autocomplete, address validation, and other data verification services offered by the platform. The following table provides an overview of the officially supported SDKs, their respective package names, installation commands, and general maturity levels.
| Language | Package/Library Name | Installation Command | Maturity |
|---|---|---|---|
| JavaScript | Loqate Web SDK | <script src="//www.loqate.com/sdk/loqate.js"></script> |
Stable |
| .NET | Loqate.NET | Install-Package Loqate.NET |
Stable |
| PHP | loqate/php-sdk | composer require loqate/php-sdk |
Stable |
| Java | Loqate Java SDK | (Maven/Gradle dependency) | Stable |
| Python | loqate-python | pip install loqate-python |
Stable |
For detailed documentation and specific usage instructions for each SDK, developers should refer to the Loqate documentation portal, which provides comprehensive guides and API references for each language.
Installation
The installation process for Loqate SDKs varies depending on the programming language and development environment. Below are typical installation methods for the officially supported SDKs.
JavaScript (Web SDK)
For web-based applications, the Loqate Web SDK is typically integrated by including a script tag directly in the HTML. This method loads the necessary library assets for client-side address lookup and validation.
<!DOCTYPE html>
<html>
<head>
<title>Loqate Address Validation</title>
</head>
<body>
<!-- Your form elements -->
<!-- Include the Loqate Web SDK -->
<script src="//www.loqate.com/sdk/loqate.js"></script>
<script>
// Your Loqate initialization code here
</script>
</body>
</html>
.NET (C#)
For .NET projects, the Loqate SDK is available as a NuGet package. It can be installed using the NuGet Package Manager Console or through the Visual Studio UI.
Install-Package Loqate.NET
Alternatively, using the .NET CLI:
dotnet add package Loqate.NET
PHP
The Loqate PHP SDK is distributed via Composer, the dependency manager for PHP. Installation involves adding the package to your composer.json file and running composer install.
composer require loqate/php-sdk
Java
For Java projects, the Loqate SDK is typically managed through build tools like Maven or Gradle. You would add the appropriate dependency to your pom.xml (Maven) or build.gradle (Gradle) file. Specific dependency coordinates can be found in the Loqate API documentation.
Example Maven dependency:
<dependency>
<groupId>com.loqate</groupId>
<artifactId>loqate-java-sdk</artifactId>
<version>1.0.0</version> <!-- Use the latest version -->
</dependency>
Python
The Loqate Python SDK can be installed using pip, the Python package installer.
pip install loqate-python
Quickstart example
This quickstart example demonstrates a basic address lookup using the Loqate API. For a complete implementation, including handling user input and displaying results, refer to the specific SDK documentation.
JavaScript (Web SDK) - Address Autocomplete
This example shows how to set up an address autocomplete field in a web form.
<!DOCTYPE html>
<html>
<head>
<title>Loqate Address Autocomplete</title>
<script src="//www.loqate.com/sdk/loqate.js"></script>
</head>
<body>
<label for="address-input">Enter Address:</label>
<input type="text" id="address-input" placeholder="Start typing your address...">
<input type="text" id="address-line1" placeholder="Address Line 1">
<input type="text" id="locality" placeholder="City">
<input type="text" id="province" placeholder="State/Province">
<input type="text" id="postal-code" placeholder="Postal Code">
<input type="text" id="country" placeholder="Country">
<script>
Loqate().setup({
key: 'YOUR_LOQATE_API_KEY', // Replace with your actual API key
input: 'address-input', // ID of the input field for autocomplete
container: '', // Leave empty to use default dropdown
onSelect: function(item) {
// When an address is selected, populate other fields
Loqate().fill({
'address-line1': item.line1,
'locality': item.locality,
'province': item.province,
'postal-code': item.postal_code,
'country': item.country
});
console.log('Selected address:', item);
}
});
</script>
</body>
</html>
Python - Address Verification
This Python example demonstrates how to perform a simple address verification using the loqate-python SDK.
import os
from loqate import Loqate
# Replace with your actual Loqate API Key
LOQATE_API_KEY = os.environ.get("LOQATE_API_KEY", "YOUR_LOQATE_API_KEY")
if LOQATE_API_KEY == "YOUR_LOQATE_API_KEY":
print("Warning: Please set LOQATE_API_KEY environment variable or replace placeholder.")
loqate_client = Loqate(api_key=LOQATE_API_KEY)
def verify_address(free_text_address):
try:
# Perform a find operation to get candidate addresses
find_results = loqate_client.find(text=free_text_address, country="USA")
if find_results and find_results.items:
first_id = find_results.items[0].id
print(f"Found candidate address ID: {first_id}")
# Retrieve the full address details using the 'retrieve' operation
retrieve_results = loqate_client.retrieve(id=first_id)
if retrieve_results and retrieve_results.items:
verified_address = retrieve_results.items[0]
print("\nVerified Address Details:")
print(f" Line 1: {verified_address.line1 or ''}")
print(f" Line 2: {verified_address.line2 or ''}")
print(f" City: {verified_address.locality or ''}")
print(f" State: {verified_address.province or ''}")
print(f" Postal Code: {verified_address.postal_code or ''}")
print(f" Country: {verified_address.country.name or ''}")
return verified_address
else:
print("Could not retrieve full address details.")
else:
print(f"No address candidates found for '{free_text_address}'.")
except Exception as e:
print(f"An error occurred: {e}")
return None
# Example usage:
address_to_verify = "1600 Amphitheatre Pkwy, Mountain View, CA"
verified_addr = verify_address(address_to_verify)
address_to_verify_uk = "10 Downing Street, London"
verified_addr_uk = verify_address(address_to_verify_uk)
Community libraries
While Loqate provides official SDKs for several popular languages, the open-source community may also develop and maintain additional client libraries or integrations. These community-contributed projects can offer support for languages not officially covered, provide alternative approaches to integration, or include specialized features. Developers considering community libraries should evaluate their maturity, active maintenance, and compatibility with the latest Loqate API versions. These libraries are not directly supported by Loqate, and their continued functionality depends on the community contributors.
As of 2026, the primary integration methods for Loqate API are through its official SDKs and direct API calls. Developers can search platforms like GitHub for community-driven projects by searching for terms such as "Loqate API", "address validation", and the specific programming language (e.g., "Loqate Ruby" or "Loqate Go"). The existence and quality of such libraries can fluctuate, and it is recommended to review the project's documentation, issue tracker, and recent commit history to gauge its reliability. For direct API interaction, developers can refer to the Loqate Address Verification API Reference to construct requests manually in any language capable of making HTTP calls, as described by the IETF's RFC 7230 for HTTP/1.1.