How can I use the REST API to get a list of my ArcGIS Online items by file size?

463
2
Jump to solution
05-27-2022 04:10 PM
MattStayner
Occasional Contributor II

Hi All!

I'm burning through my ArcGIS Online credits. All the credits are being used for storage. I know I have a bunch of old files taking up space. There is no way (that I can see) to sort items by file size on ArcGIS Online.

How can I use the REST API to get a list of my ArcGIS Online items by file size?

Thanks!

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
MattStayner
Occasional Contributor II

Thanks @Raul_Jimenez!

I didn't realize there was that information on the ArcGIS Online page. Here's where I went:

  1. Organization Page
  2. Status Tab
  3. Credits Tab
  4. "Storage" under "Credit Utilization Chart"
  5. "Feature Storage"
  6. "Standard Feature Data Storage"
  7. View Item Details

When I clicked on that, I saw in the network traffic that it calls this endpoint: https://[root]/portals/[portalID]?f=json&num=50&start=1&sortField=size&sortOrder=desc&types=Feature%20Service&reservedTypeKeyword=Hosted%20Service&token=[token]

See here for the details for that endpoint: https://developers.arcgis.com/rest/users-groups-and-items/portal.htm

That's what I needed! Thanks!

View solution in original post

2 Replies
Raul_Jimenez
Esri Contributor

Hi Matt,

I don't have access admin privileges to any ArcGIS Online organization right now (I only use ArcGIS Developer accounts), but a long time ago I did this documentation explaining how to check the detailed credit consumption, I remember it was possible to query and filter per FeatureService.

If you are able to find it, you will be able to check the network requests to better understand how to query it through the REST API because I don't think it is documented on the developer site.

I hope the resources on that page are helpful. If after checking you still need help let me know.

0 Kudos
MattStayner
Occasional Contributor II

Thanks @Raul_Jimenez!

I didn't realize there was that information on the ArcGIS Online page. Here's where I went:

  1. Organization Page
  2. Status Tab
  3. Credits Tab
  4. "Storage" under "Credit Utilization Chart"
  5. "Feature Storage"
  6. "Standard Feature Data Storage"
  7. View Item Details

When I clicked on that, I saw in the network traffic that it calls this endpoint: https://[root]/portals/[portalID]?f=json&num=50&start=1&sortField=size&sortOrder=desc&types=Feature%20Service&reservedTypeKeyword=Hosted%20Service&token=[token]

See here for the details for that endpoint: https://developers.arcgis.com/rest/users-groups-and-items/portal.htm

That's what I needed! Thanks!