Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

USPS Address Standardization Web Tool

Featured Replies

I'm looking at the USPS's Web Tools™ API for address standardization and it seems a pretty straight forward XML request response loop but as I'm a lazy guy I'm wondering if anyone else had done this already?

Given that I've never seen the solution out there, what sort of pitfalls might I get trying to implement it in FM?

Thanks

Oh, for those who might be interested the details can be found at:

USPS Web Tool APIs

Edited by Guest
add url

Did you look in the example file folder that came with FileMaker's Application Folder. There is an example of this there?

There also examples at

Databasepros.com

Briandunning.com

filemakermagazine.com

and you might do a search of http://searchfilemaker.com/ for Web Viewer and you might pull up a couple of more.

HTH

Lee

The FileMaker WebViewer example shows how to do UPS tracking, and Brian Dunning's site sells zip code databases that use latitude and longitude to calculate distances, etc., but the only tool I found like what Horatio was talking about (via searchfilemaker.com--like that site) was the USPS Verify BlackBox tool from DataIsland.com. It seems to be reasonably priced, though it requires the Troi URL plugin.

I tried signing up to access the USPS API once, and the site told me it couldn't be used (at least not by me) for any type of address verification or data processing, after making me register and specify what I wanted to use it for from a list of choices. Maybe they have loosened their restrictions since then.

At some point, I will probably look into the DataIsland software or get one of the raw zip code files from Brian Dunning's site (via Zipwise.com). Any other ideas?

There are several things at Brian Dunning's Site, including the Custom Function Library, and some Web View Examples.

In the Web View Examples, there is at least one for DHL, USPS, UPS, along with some for Geocoding

Lee

The attached example file has 3 different methods. The first came from someone else's file. I cannot remember who, so please take credit if it was yours. The file itself did not say who it was.

1. Web Viewer method, using (longish) FileMaker script to parse out the data.

2. zippShell method; similar to above, but using zippShell and curl to get the data. Windows users could use curl, or substitute wget instead. It uses the same FileMaker script method to parse the data.

3. My own method; uses AppleScript and curl to to get the data. Uses AppleScript running do shell scripts command line to parse the data. It is the fastest.

4. I haven't see the USPS xml commands yet. That would likely be the best method. The parsing seems to be fairly fast, and a stable structure; but I'd prefer xml. I'll have to check that out.

(The file is just the lightweight verify the address, nothing fancy.)

[P.S. I changed the file slightly. I used the "strings" command to remove blank lines that curl returned, in the AppleScript method. It makes the parsing more reliable.]

[1/23/2011 Modified original file to use 'printf' instead of 'echo', as the '-n' option is mostly unsupported on Macs anymore.]

USPS AddressVerify_fej.fp7.zip

Wow. Nice work. I don't know about Horacio, but this is all I would ever need. And it gets the info straight from the USPS site, not through a third-party web service that might not be around forever.

WebViewer Example was mine. This works well most of the time but will fail to standardize the address if more than one result is returned.

I changed the file slightly. I used the "strings" command to remove blank lines that curl returned, in the AppleScript method. It makes the parsing more reliable. And put your name on your method :-]

  • Author

Excellent! This aprses the jsp version of the USPS adress validator. And certainly works well enough. I was interested in how to approach the USPS xml request response APIs but it would seem there are some "usage agreement" issues so this works well enough, in fact it works which is way better than the xml approach.

I'm going to play with this solution for the moment and explore the API's later

Thanks again!!!

Yeah, I looked at the xml. My first impression was, wow, this looks simple, this is the way to go. Then, when I applied for "permission" to use it to standardize database records, they wrote back that permission was denied, but I could buy it on CDs for $3,800 a year.

Edited by Guest
Removed seditious propaganda

I'm glad it wasn't just me who was miffed by their policies and the way they made them known. The form I filled out had several options related to standardization, only to have them come back and say, in so many words, "you'd like to do that, huh? Well, you can't. And now we know where you live if you try to do it anyway."

  • 2 months later...

FYI: The County information provided by USPS.com is NOT 100% accurate. (I have had several instances that this has caused me problems.)

  • 1 year later...
  • Newbies

Novice here -- sort of. Was a DBA years ago so have a solid grasp of concepts, but very rusty skills and getting back into the swing of things. Trying to scrub the addresses from customer orders prior to shipping via USPS, and like the AppleScript version of this. Problem is, I'm not sure how to move what's here over into my environment. I can run the table and its set of all three types of scripts fine, but when I try and move over the GetAddressAS script, there are glitches.

Anyone feel like pointing an eager learning at a good primer on whatever it is I'm trying to do is even called? Import a script? Integrate an external table? I have my own address block, and want to add a button that does what the "Validate" button does on this one?

  • 4 months later...
  • Newbies

The attached example file has 3 different methods. The first came from someone else's file. I cannot remember who, so please take credit if it was yours. The file itself did not say who it was.

1. Web Viewer method, using (longish) FileMaker script to parse out the data.

2. zippShell method; similar to above, but using zippShell and curl to get the data. Windows users could use curl, or substitute wget instead. It uses the same FileMaker script method to parse the data.

3. My own method; uses AppleScript and curl to to get the data. Uses AppleScript running do shell scripts command line to parse the data. It is the fastest.

4. I haven't see the USPS xml commands yet. That would likely be the best method. The parsing seems to be fairly fast, and a stable structure; but I'd prefer xml. I'll have to check that out.

(The file is just the lightweight verify the address, nothing fancy.)

[P.S. I changed the file slightly. I used the "strings" command to remove blank lines that curl returned, in the AppleScript method. It makes the parsing more reliable. And put your name on your method <img src='http://fmforums.com/forum/public/style_emoticons/<#EMO_DIR#>/biggrin.gif' class='bbc_emoticon' alt=':' />-]

Thank you very much for this file. It is very helpful. However the Apple Script method seems to break and it returns "-n" in the State and City and Zip fields. I'm using FMPA 11 and Snowleopard.

Thank you very much for this file. It is very helpful. However the Apple Script method seems to break and it returns "-n" in the State and City and Zip fields. I'm using FMPA 11 and Snowleopard.

Modified Fenton's version, stripped -n flag and added some error checks to other calcs.

Works for me in FM11A/Snow Leopard.

From man page for echo:

Some shells may provide a builtin echo command which is similar or identical to this utility. Most

notably, the builtin echo in sh(1) does not accept the -n option. Consult the builtin(1) manual page.

USPS AddressVerify_fej_bfr.fp7.zip

  • Newbies

Thank you! No more problems with this file.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.