Select to view content in your preferred language

Can REST API return partial results instead of 500?

540
3
08-24-2022 05:49 AM
mfeldmei
New Contributor

I'm attempting to bulk geocode a set of addresses through the REST API from a Node.js client using the /geocodeAddresses?f=json endpoint. The problem is that if I send 50 addresses, and one of them is unmappable, the entire request comes back as a 500 server error:

{"errors":[{"errorCode":"INTERNAL_ERROR","errorDescription":"An error occurred while processing request, null"}]}

Is there a way that I'm not understanding to tell it to return the rest of the results without scramming the entire request? Sending them one at a time is unrealistic due to the volume of addresses involved.

Example (this will return only a 500 response, instead of one mapped and one unmapped result):

addresses={"records":[{"attributes":{"OBJECTID":1,"SingleLine":"9999 PENNSLYVANIA AVE NW,WASHINGTON,DC,20500"}},{"attributes":{"OBJECTID":1,"SingleLine":"1600 PENNSLYVANIA AVE NW,WASHINGTON,DC,20500"}}]}

 

Appreciate any thoughts on this!

0 Kudos
3 Replies
JeffSilberberg
Occasional Contributor III

 

Interesting question --  Have you looked at the Documentation 

     https://developers.arcgis.com/rest/geocode/api-reference/geocoding-geocode-addresses.htm

Specifically the Category and Fallback section -- 

You can also use category filtering to avoid "low resolution" fallback matches. By default if the geocoding service cannot find a match for an input address it will automatically search for a lower match level, such as a street name, city, or postal code. For batch geocoding a user may prefer that no match is returned in such cases so that they are not charged for the geocode. If a user passes category=Point Address,Street Address in a geocodeAddresses request, no fallback will occur if address matches cannot be found; the user will only be charged for the actual address matches. ---

 

0 Kudos
mfeldmei
New Contributor

Hi Jeff, thanks for your response.

Yes, I read that more than once.  If I'm understanding what it's saying, applying this would just further restrict the results that are actually matched.  In any case, adding several variations of it doesn't affect the outcome in my case; I still just get the error.  (tried &category=Address, &category=Point Address, &category=Point%20Address, etc.)

0 Kudos
JeffSilberberg
Occasional Contributor III

 

  Then I would suggest in addition to this posting that you call support as the 500 Error is from the service  not something you have much control over beyond the documented variables... 

 

0 Kudos