International Street Address API

International Street Address API

Geocoding

Convert addresses into proper USPS or international address format

Visit API

πŸ“š Documentation & Examples

Everything you need to integrate with International Street Address API

πŸš€ Quick Start Examples

International Street Address API Javascript Examplejavascript
// International Street Address API API Example
const response = await fetch('https://smartystreets.com/products/apis/international-street-api', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/json'
    }
});

const data = await response.json();
console.log(data);

Introduction

In today's world, we heavily rely on digital communication and the internet. Thus, it becomes crucial for companies to keep their data up-to-date, for example, their address database. One of the most challenging aspects of maintaining an updated address database includes dealing with international addresses.

That's why we have APIs like SmartStreet's International Street API. In this blog post, we will discuss the basics of the International Street API and provide examples of how to use it using JavaScript.

SmartStreet's International Street API

The International Street API enables you to validate, standardize, and enrich international addresses. With its extensive coverage of international addresses, the API is a comprehensive solution for businesses operating globally. It supports over 200 countries and territories worldwide.

Authentication

To use the International Street API, you need an API key provided by SmartStreet. You can visit their website to get started.

Basic Usage

Now, let's explore some basic examples of using the International Street API.

Validate an International Address

const API_KEY = "YOUR_API_KEY";
const URL = `https://us-street.api.smartystreets.com/verify-international?auth-id=${API_KEY}&`;
const address = "2 rue LΓ©on Blum, 92800 Puteaux, France";
const urlEncodedAddress = encodeURIComponent(address);
const requestURL = `${URL}address=${urlEncodedAddress}`;

fetch(requestURL)
  .then((response) => response.json())
  .then((data) => {
    console.log(data);
  });

In this example, we first define the API Key provided by SmartStreet. Using this key, we construct the request URL by adding the auth-id parameter to the endpoint https://us-street.api.smartystreets.com/verify-international?. We then encode the address using encodeURIComponent and append it to the URL. Finally, we make a fetch request and print the response to the console.

Find Suggestions for an Incomplete Address

const API_KEY = "YOUR_API_KEY";
const URL = `https://us-street.api.smartystreets.com/autocomplete?auth-id=${API_KEY}&`;
const address = "2 rue";
const urlEncodedAddress = encodeURIComponent(address);
const requestURL = `${URL}prefix=${urlEncodedAddress}`;

fetch(requestURL)
  .then((response) => response.json())
  .then((data) => {
    console.log(data);
  });

In this example, we use the autocomplete endpoint to find suggestions for an incomplete address. We construct the request URL in the same way as before, but this time we use the prefix parameter to pass the partial address. Again, we make a fetch request and print the response to the console.

Conclusion

In this blog post, we explored the basics of the International Street API and provided examples in JavaScript. You can use these examples as a starting point to integrate the International Street API into your application. With the API's comprehensive coverage and easy-to-use interface, it becomes straightforward to standardize and validate international addresses.

πŸ“Š 30-Day Uptime History

Daily uptime tracking showing online vs offline minutes

Jun 10Jun 12Jun 14Jun 16Jun 18Jun 20Jun 22Jun 24Jun 26Jun 28Jun 30Jul 2Jul 4Jul 6Jul 904008001440Minutes
Online
Offline

Related APIs in Geocoding