13

I have a dataset that contains many addresses (60,000-ish entries). I want to classify these addresses into either residential or business addresses.

Does anyone know a good API/Service to get started doing this?

  • I don't think the google maps geocoder can do this at this time.

  • Fedex and UPS both seem to have API's but they are only released to companies that are shipping products (sort of a need to know basis only)

USPS API: https://www.usps.com/nationalpremieraccounts/rdi.htm

Fedex API:http://www.fedex.com/us/developer/web-services/index.html

This is a hobby project, so free or cheap are better! But paid solutions are not out of the question.

gene_wood
  • 1,960
  • 4
  • 26
  • 39
Ben Holland
  • 2,309
  • 4
  • 34
  • 50
  • 1
    Just be aware that the only real official data about these things comes from the USPS itself, which licenses the data for shipping rate comparison only... so remember to check terms before diving in. – Matt Jul 06 '12 at 19:39

4 Answers4

7

As mentioned previously, RDI is the way to go. RDI stands for "residential delivery indicator" and it tells you whether an address is residential or commercial. The only issue with that is you have to be a developer to use it and you have to have standardized and certified addresses, not to mention the annual licensing fee from the USPS for hundreds of dollars. Once you've got it and programmed a solution, you can just give it an address with any old ZIP and expect it to work. The address must have the full 12-digit delivery point barcode.

Or you could use a service provider to do the same thing and pay about $50-100 for a list your size.

Full disclosure: I'm the founder of SmartyStreets. We have RDI included into our offering at no extra charge. This means it's as simple as dragging your list to our website and having it processed and back in seconds. We also offer an address verification web service API which will returns the residential/business indicator to let you know the kind of address you're working with.

Jonathan Oliver
  • 5,207
  • 32
  • 31
2

Whitepages claims they let you do that in their API. For hobby purposes of up to 200 queries per day, it's free. You would query zoning type.

The Address ID Data Structure contains a "usage" field, which is described as "Only valid for US address LocationType. This indicates the US Postal Service opinion about whether this address is primarily a "Business" or "Residential"."

Ben Holland
  • 2,309
  • 4
  • 34
  • 50
kayleighsdaddy
  • 670
  • 5
  • 15
0

This is a bit of a hack, but why not write a script to check to see if the first line of the address contains any of the last names from the census list? That should get you most of the residential addresses. Assuming the person's/business's name is part of the address you have.

Swordgleam
  • 38
  • 1
  • 5
  • That is a bit of a hack. I'm afraid that might produce a lot of false positives. Example John Smith @ blah blah drive would hit on Smith & Wesson store locations. – Ben Holland Oct 27 '10 at 20:04
  • That is a good point. You could refine it a bit to avoid characters that aren't in names and to look for first name or Mr/Mrs/etc and a last name, but it's still far from perfect. – Swordgleam Oct 27 '10 at 22:12
0

Take a look at the API at http://compass.webservius.com

It's a listing of 16+ million businesses in the US (aims to be a complete business listing). If an address isn't there, chances are it's a residential address.

Eugene Osovetsky
  • 6,443
  • 2
  • 38
  • 59
  • This looks really good. I'll have to give it a spin. I'll post back some code if it worked out! – Ben Holland Oct 28 '10 at 21:10
  • Finally got around to coding this up. This solution didn't quite pan out for me. The API is kind of strict in that it requires exact matches or exact prefix matches for the search parameters, so a lot of non residential address weren't found in the API results which sort of skewed my results. I also tried a bounding box approach using lat,lng (which I also have for my dataset), but the results seemed to be lacking. Maybe I'm going about it the wrong way, or maybe I need to normalize my addresses somehow. – Ben Holland Jan 21 '11 at 21:25