Google geocode API returns inconclusive results

試著忘記壹切 提交于 2019-12-04 11:57:13

Google does a wonderful job at address approximation. What you're looking for is address verification. SmartyStreets provides an address verification API that is conclusive in it's results. Here's what the SmartyStreets API returns for that address:

Input:

https://api.qualifiedaddress.com/street-address/?street=16160%20Frederick%20Rd&street2=&city=gaithersburg&state=md&zipcode=20877&candidates=10&auth-token=YOUR_AUTHENTICATION_TOKEN_HERE

Output:

[
    {
        "input_index": 0,
        "candidate_index": 0,
        "delivery_line_1": "16160 Frederick Rd",
        "last_line": "Gaithersburg MD 20877-4011",
        "delivery_point_barcode": "208774011604",
        "components": {
            "primary_number": "16160",
            "street_name": "Frederick",
            "street_suffix": "Rd",
            "city_name": "Gaithersburg",
            "state_abbreviation": "MD",
            "zipcode": "20877",
            "plus4_code": "4011",
            "delivery_point": "60",
            "delivery_point_check_digit": "4"
        },
        "metadata": {
            "record_type": "S",
            "county_fips": "24031",
            "county_name": "Montgomery",
            "carrier_route": "C004",
            "congressional_district": "08",
            "latitude": 39.12162,
            "longitude": -77.17619,
            "precision": "Zip9"
        },
        "analysis": {
            "dpv_match_code": "Y",
            "dpv_footnotes": "AABB",
            "dpv_cmra": "N",
            "dpv_vacant": "N",
            "ews_match": false
        }
    }
]

Notice that the "dpv_match_code" is "Y". That's USPS-speak for a verified delivery point--you know that it's a real address at that point. SmartyStreets uses official, current USPS data and is a CASS-Certified software provider.

The API is free for non-profits, educational institutions and low-usage users. Once you've received a result from SmartyStreets you could then geocode it with Google. Full disclosure: I'm a developer at SmartyStreets.

EDIT: Added Latitude/Longitude fields (newly released)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!