Select to view content in your preferred language

Content Search returns a JSON decode error when max_items is set to a big number

06-06-2023 12:53 PM
New Contributor

When I use the ArcGIS API for Python content manager's search method to get ArcGIS Portal contents based on content type, if I set the "max_items" to 300 or higher, most of the times, it would return a JSON decode error. But this error doesn't always occur. Sometimes, if I execute the same code, it works just fine. if I set "max_items" to 250 or below, usually it works without any issues. I don't see anything in the API documentation that mentions a limit for the "max_items" in content search. Anyone had this issue before? Is there any workarounds?

The JSON decode error I caught:

JSONDecodeError('Expecting value: line 1 column 1 (char 0)')

The content search code:

allMapImgLayers ='', item_type='Map Image Layer', max_items=500)


Any suggestions would be appreciated! Thanks!


0 Replies