The /api/v2/afc/PCode
Jurisdiction Determination endpoint returns a list of PCodes associated with a specified location.
The PCode Jurisdiction Determination endpoint accepts a PCode Lookup Request. Specify a location, best match or exact match, and how many results you want to see. Location data, including PCode, is returned along with additional details in the PCode Lookup Result.
Specify a location.
CountryISO
)State
)County
)City
)ZipCode
)NpaNxx
)Fips
)NpaNxx
and Fips
to get a range of valuesThe Best Match flag (BestMatch
) indicates the type of results.
true
: Best match is returnedfalse
: Only an exact match is returnedMatchTypeApplied
Zip Lookup Result field to see which match type is usedThe Limit Results field (LimitResults
) is used to limit the number of matches returned in the Zip Lookup Result.
0
sets the limit to the defaultThis example demonstrates a best match PCode Jurisdiction Determination request.
{ "CountryIso": "USA", "State": "MN", "County": "SAINT LOUIS", "City": "EVELETH", "ZipCode": "55734", "BestMatch": true, "LimitResults": 10}
One location (LocationData
) is returned using a best match (MatchTypeApplied
).
{ "LocationData": [ { "CountryIso": "USA", "State": "MN", "County": "ST LOUIS", "Locality": "EVELETH", "PCode": 1956600 } ], "MatchCount": 1, "InputMatchType": "Best", "MatchTypeApplied": "Best", "ResultsLimit": 10}
This example demonstrates a best match request using only a zip code (ZipCode
).
{ "ZipCode": "10001", "BestMatch": true, "LimitResults": 25}
Five locations (LocationData
) are returned using an exact match (MatchTypeApplied
).
{ "LocationData": [ { "IsAlternate": true, "CountryIso": "USA", "State": "NY", "County": "NEW YORK", "Locality": "EMPIRE STATE", "PCode": 2604100 }, { "IsAlternate": true, "CountryIso": "USA", "State": "NY", "County": "NEW YORK", "Locality": "GREELEY SQUARE", "PCode": 2604100 }, { "IsAlternate": true, "CountryIso": "USA", "State": "NY", "County": "NEW YORK", "Locality": "ONE HUNDRED THIRTY EIGHTH", "PCode": 2604100 }, { "IsAlternate": true, "CountryIso": "USA", "State": "NY", "County": "NEW YORK", "Locality": "MANHATTAN", "PCode": 2604100 }, { "CountryIso": "USA", "State": "NY", "County": "NEW YORK", "Locality": "NEW YORK", "PCode": 2604100 } ], "MatchCount": 5, "InputMatchType": "Best", "MatchTypeApplied": "Exact", "ResultsLimit": 25}
This example demonstrates a PCode lookup in India (CountryISO
is set to “IND”).
{ "CountryIso": "IND", "State": "AP", "City": "Tirumala", "BestMatch": true, "LimitResults": 1}
The country of India (CountyISO
) is returned even though a local jurisdiction is requested.
{ "LocationData": [ { "CountryIso": "IND", "State": "", "County": "", "Locality": "", "PCode": 5148400 } ], "MatchCount": 1, "InputMatchType": "Best", "MatchTypeApplied": "Best", "ResultsLimit": 1}
Similar to Example 3, but with an exact match requested (BestMatch
set to false
).
{ "CountryIso": "IND", "State": "AP", "City": "Tirumala", "BestMatch": false, "LimitResults": 1}
No results are returned because an exact match for the requested jurisdiction can’t be found.
{ "LocationData": null, "MatchCount": 0, "InputMatchType": "Exact", "MatchTypeApplied": "Exact", "ResultsLimit": 1}
This example demonstrates both an NPANXX and Fips code range by using a “*”.
{ "CountryIso": "USA", "State": "KS", "County": "Johnson", "NpaNxx": "816*", "Fips": "9901250415*", "LimitResults": 12}
Results are limited to 14 jurisdictions:
{ "LocationData": [ { "CountryIso": "USA", "State": "MO", "County": "", "Locality": "", "PCode": 2047400 }, { "CountryIso": "USA", "State": "MO", "County": "LIVINGSTON", "Locality": "CHILLICOTHE", "PCode": 2119300 }, { "CountryIso": "USA", "State": "MO", "County": "CASS", "Locality": "KANSAS CITY", "PCode": 2067600 }, { "CountryIso": "USA", "State": "MO", "County": "BUCHANAN", "Locality": "SAINT JOSEPH", "PCode": 2058600 }, { "CountryIso": "USA", "State": "MO", "County": "JOHNSON", "Locality": "WARRENSBURG", "PCode": 2109600 }, { "CountryIso": "USA", "State": "MO", "County": "ADAIR", "Locality": "KIRKSVILLE", "PCode": 2047600 }, { "CountryIso": "USA", "State": "MO", "County": "JACKSON", "Locality": "KANSAS CITY", "PCode": 2102300 }, { "CountryIso": "USA", "State": "MO", "County": "CLAY", "Locality": "KANSAS CITY", "PCode": 2074600 }, { "CountryIso": "USA", "State": "MO", "County": "PLATTE", "Locality": "KANSAS CITY", "PCode": 2149800 }, { "CountryIso": "USA", "State": "MO", "County": "JACKSON", "Locality": "KANSAS CITY", "PCode": 2102300 }, { "CountryIso": "USA", "State": "MO", "County": "PLATTE", "Locality": "KANSAS CITY", "PCode": 2149800 }, { "CountryIso": "USA", "State": "MO", "County": "BUCHANAN", "Locality": "SAINT JOSEPH", "PCode": 2058600 }, { "CountryIso": "USA", "State": "KS", "County": "JOHNSON", "Locality": "OVERLAND PARK", "PCode": 1248900 }, { "CountryIso": "USA", "State": "KS", "County": "JOHNSON", "Locality": "", "PCode": 1248000 } ], "MatchCount": 13, "InputMatchType": "Best", "MatchTypeApplied": "Exact", "ResultsLimit": 12}