Turn a one-line US address into clean fields. Paste an address and get the street number, street name, type, direction, city, state and ZIP, ready for a form or a database.
This template needs an APIVerve API key. Sign up free, no credit card required.
Click Deploy with Vercel above. Vercel copies this repo to your GitHub account, asks for your APIVERVE_API_KEY, and gives you a live URL about a minute later.
-
Clone the repository
git clone https://github.com/apiverve/address-parser-node-tutorial.git cd address-parser-node-tutorial -
Install dependencies
npm install
-
Add your API key
cp .env.example .env
Then open
.envand setAPIVERVE_API_KEY. -
Start the server
npm run dev
-
Open
http://localhost:3000
- The page in
public/index.htmlcallsGET /api/parse?address=on this server. server.jschecks the input, then calls Street Address Parser. Your API key stays on the server and never reaches the browser.- The page shows the result.
├── server.js # Express: the /api route that calls APIVerve
├── public/index.html # The page (HTML, CSS and JavaScript)
├── .env.example # Copy to .env and add your key
└── package.json
const res = await fetch(
`https://api.apiverve.com/v1/streetaddressparser?address=${encodeURIComponent(address)}`,
{ headers: { 'x-api-key': process.env.APIVERVE_API_KEY } }
);
const { data } = await res.json();
// data.parsed.streetNumber, streetAddress, streetType, cityName, stateName, zipCodeOnce deployed, anyone who finds your URL can use it on your API key. Each visitor can make 10 requests a minute, which is fine for a demo. The limit is kept in memory, so it isn't shared between serverless instances. For production:
- Put the page behind your own sign-in, or
- Move the limit to a shared store such as Upstash Redis, or
- Call the route only from your own backend.
- Let people paste a whole address, then fill in your checkout fields for them
- Clean up a CSV of addresses before importing it
- Add ZIP Codes Lookup to check the ZIP matches the city
- Street Address Parser:
GET https://api.apiverve.com/v1/streetaddressparser?address= - Full documentation
- Node.js 20+ and Express 4
- Plain HTML, CSS and JavaScript, no build step
- Deploys to Vercel as-is:
server.jsbecomes one function andpublic/is served from the CDN
MIT. See LICENSE.
