Portal items- number of views

05-02-2018 09:47 PM
New Contributor III

Somewhere in conversation, I came across a json url which gives me the number of views on the particular item be it a webmap, app, kml.

Have lost it .Can someone point me out correctly?

Is it something that only an admin can do?

11 Replies
Esri Esteemed Contributor

Each item in portal has a property "numViews":

Item—ArcGIS REST API: Users, groups, and content | ArcGIS for Developers 

See an example using Python to get the items sorted by the number of views (at the bottom of the page):

Example: Update the URL of a service in a web map—Portal for ArcGIS (10.6) | ArcGIS Enterprise  

I guess you will need to have access to the items to be able to retrieve the properties.

New Contributor III

That's near to what I wanted. We have few items not worth running a script.

Can you give me the Url that returns me the number of items in html , json formats? You know something like <portal>.arcgis.com\sharing\rest\....\....\ where I can view the output

0 Kudos
New Contributor III

why do certain people come and just post in answers not even fully understanding the question? Everyone here isn't looking for APIs though it's a good medium

Esri Notable Contributor

Anything you're looking at in the Portal home app is driven from an API...

Anyway, you can use the home app to find the number of views:


Or users content within Sharing API that the home app is getting its information from:


Or by searching in the home app:

Or by searching in the Sharing API, which is what searching in the Sharing API is giving you:

New Contributor II

Hi all,

is it possible to retrieve the numviews property filtered by user? I mean, is there any log where I could find the items viewed by a user?

Thanks in advance.

New Contributor

Hello @BorjaParés_Fuente , 

I came across your comment and this is exactly one of the things I am currently trying to achieve! This was three years ago, but maybe you remember how you solved this? Thanks for any tip you might have. 

0 Kudos
New Contributor


   Is it possible to reset the numViews value back to zero? 

0 Kudos
Occasional Contributor II

Using the ArcGIS API for Python you can do the following:

import arcgis
from arcgis.gis import GIS

# Org URL
url = "https://nation.maps.arcgis.com"

# Make a connection to the portal
gis = GIS(url=url)

# Item ID
# Using a public story map for this example
# https://nation.maps.arcgis.com/apps/Cascade/index.html?appid=e4ae5b57cf9045288909a93cc31cde7c
item = "e4ae5b57cf9045288909a93cc31cde7c"

i = gis.content.get(item)
New Contributor III

I found a bug/error in ESRI REST API, please fix the bug in code or update doc either way:


the api reads:      


also give example at bottom


You actually will NOT get any info by use above link format. Only a blank page

You must add  


by define format to get something

This is a working example:


esri staff, please fix the rest api code, by define 'f=json' format by default.

or update the rest api doc above, by put a NOTE: * remind user must append ?f=json at the url end