I'm using https://community.esri.com/thread/239341-find-all-content-for-all-users-in-an-agol-subscription-pars... to pull some statistics, but I'm finding the output limited to 10000 rows, and I know we have more than 10000 items.
Solved! Go to Solution.
Make sure you are working in milleseconds. Search reference—ArcGIS REST API: Users, groups, and content | ArcGIS for Developers :
The created field contains the date and time an item is created in UNIX time. UNIX time is defined as the number of seconds that have elapsed since midnight January 1, 1970. The portal stores time in milliseconds, so you need to add three zeros to the end of the UNIX time.
Or a better way to ask this:
Is there a way to specify date ranges in gis.content.search ?
I see https://community.esri.com/thread/224718-arcgis-api-for-python-find-latest-items there is a way to go back so many days, what I'm after is a way to specify a between range, say, I want every item created from 2014-2016, which would allow me to do multiple queries under the 10000 item limit, then concatenate the results.
The simo xu response to the thread you reference appears to answer your question, albeit using "now" for one of the date ends. Have you tried that code just with different dates?
err....ahhhh....I'm "trying". Not the brightest python bulb in the room here. When you say hard code the now part, would that be
now = someunixtimestamp
So I've tried:
now = '1567084745'
then = '1546300800'
And both return nothing
Make sure you are working in milleseconds. Search reference—ArcGIS REST API: Users, groups, and content | ArcGIS for Developers :
The created field contains the date and time an item is created in UNIX time. UNIX time is defined as the number of seconds that have elapsed since midnight January 1, 1970. The portal stores time in milliseconds, so you need to add three zeros to the end of the UNIX time.
So here's what ended up working:
itemsList = gis.content.search(query = 'created: [1559394001000 TO 1567086853000]', max_items = 10000000)
But now I'm running into another road block: we create a lot of content! I originally went back to Jan of 2019, which still put me against the 10000 item throttle limit. So chunking this up into 6-month calls is a little time consuming, as I need to go back to 2010.