Address parser template

  • Node.js
  • Express

Split a one-line US address into street number, street, city, state and ZIP.

A Node.js and Express app that turns a US address typed on one line into clean, separate fields: street number, street name, street type, direction, city, state and ZIP. Paste an address, or try one of the examples, and see each part. Use it to fill in checkout forms or clean up imported addresses.

The address parser app running

What it does

Every part of the address
Returns the street number, name, type (Ave, St), direction (NW), city, state and ZIP as separate fields.
Works on messy input
Takes the address the way people type it, on one line with commas or without.
Keeps your key private
The page calls your own server, which holds the key and limits each visitor to 10 requests a minute.

How it works

The route that parses an address.

server.js
// GET /api/parse?address=
app.get('/api/parse', async (req, res) => {
  const address = str(req.query.address, 300);
  if (!address) return res.status(400).json({ status: 'error', error: 'Enter an address.' });

  try {
    const data = await callApi('streetaddressparser', { query: { address } });
    res.json({ status: 'ok', error: null, data });
  } catch (err) {
    res.status(err.status || 502).json({ status: 'error', error: err.message });
  }
});

See the whole file on GitHub

Deploy it

  1. Get a free API key

    The free plan includes 200 credits a month, no card needed. Create your key.

  2. Deploy it

    Click Deploy to Vercel. Vercel copies the repo to your GitHub account and asks for APIVERVE_API_KEY: paste your key there.

  3. Open your app

    Vercel builds it and gives you a live URL, usually in about a minute. Every push to the repo redeploys it.

Try the Street Address Parser API — the call this template makes

Request
GETapi.apiverve.com/v1/streetaddressparser?address=1600%20Amphitheatre%20Parkway%2C%20Mountain%20View%2C%20CA%2090210
Query parameters
Verification
Format

No key required to try it. Get a key to use it in your app.

Example
{
  "status": "ok",
  "error": null,
  "data": {
    "address": "1600 Amphitheatre Parkway, Mountain View, CA 90210",
    "parsed": {
      "streetNumber": "1600",
      "streetType": "Pkwy",
      "streetAddress": "Amphitheatre",
      "cityName": "Mountain View",
      "stateName": "CA",
      "zipCode": "90210"
    }
  }
}

Build your own with Street Address Parser. Start with 200 free credits. One key unlocks all 300+ APIs.

Explore the catalog

300+ APIs on the same key and the same response shape.

Browse all APIs