<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Item usage not correctly getting requests in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/item-usage-not-correctly-getting-requests/m-p/1272990#M67287</link>
    <description>&lt;P&gt;Thank you,&amp;nbsp; I will look into this.&lt;/P&gt;</description>
    <pubDate>Wed, 29 Mar 2023 12:11:33 GMT</pubDate>
    <dc:creator>Ian-Horn</dc:creator>
    <dc:date>2023-03-29T12:11:33Z</dc:date>
    <item>
      <title>Item usage not correctly getting requests</title>
      <link>https://community.esri.com/t5/python-questions/item-usage-not-correctly-getting-requests/m-p/1272901#M67284</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to be able to query the number of item requests during a certain time period. If I use:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;ap_hits = ap_item.usage(date_range = '6M, as_df = True)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-03-28 at 11.25.57 PM.jpg" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/66615i87E92B5BB470EA8C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-03-28 at 11.25.57 PM.jpg" alt="Screenshot 2023-03-28 at 11.25.57 PM.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; But if I uses date_range = '24', '7D', '30D', or '60D' it comes up as None&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-03-28 at 11.31.04 PM.jpg" style="width: 663px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/66616i8281C5ECDC3C3AE2/image-dimensions/663x141?v=v2" width="663" height="141" role="button" title="Screenshot 2023-03-28 at 11.31.04 PM.jpg" alt="Screenshot 2023-03-28 at 11.31.04 PM.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As you can see from the '6M' option, I do have requests in the last 7D.&amp;nbsp; Why can't I do get the requests with specific time dates less than 6 months?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2023 03:37:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/item-usage-not-correctly-getting-requests/m-p/1272901#M67284</guid>
      <dc:creator>Ian-Horn</dc:creator>
      <dc:date>2023-03-29T03:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Item usage not correctly getting requests</title>
      <link>https://community.esri.com/t5/python-questions/item-usage-not-correctly-getting-requests/m-p/1272915#M67285</link>
      <description>&lt;P&gt;BUG-000155249&lt;/P&gt;&lt;P&gt;You can get the usage if you don't return it as a data frame:&lt;/P&gt;&lt;PRE&gt;testDictionary = item.usage(date_range='30D',as_df=False)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;But then you have to combine them together. I made a spreadsheet from the dict. Another user sums it, example here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/the-usage-property-for-an-item-returns-none-or/td-p/1241968" target="_blank" rel="noopener"&gt;https://community.esri.com/t5/arcgis-api-for-python-questions/the-usage-property-for-an-item-returns-none-or/td-p/1241968&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2023 05:24:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/item-usage-not-correctly-getting-requests/m-p/1272915#M67285</guid>
      <dc:creator>ChristopherCounsell</dc:creator>
      <dc:date>2023-03-29T05:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: Item usage not correctly getting requests</title>
      <link>https://community.esri.com/t5/python-questions/item-usage-not-correctly-getting-requests/m-p/1272990#M67287</link>
      <description>&lt;P&gt;Thank you,&amp;nbsp; I will look into this.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2023 12:11:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/item-usage-not-correctly-getting-requests/m-p/1272990#M67287</guid>
      <dc:creator>Ian-Horn</dc:creator>
      <dc:date>2023-03-29T12:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: Item usage not correctly getting requests</title>
      <link>https://community.esri.com/t5/python-questions/item-usage-not-correctly-getting-requests/m-p/1357752#M69347</link>
      <description>&lt;P&gt;BUG-000155249 has been fixed. Can confirm that returning as data frame now works expected&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;from arcgis.gis import GIS&lt;/P&gt;&lt;P&gt;gis = GIS("home")&lt;/P&gt;&lt;P&gt;# Replace 'item_id' with the actual ID of the item you want to retrieve&lt;BR /&gt;item_id = ''&lt;/P&gt;&lt;P&gt;# Get the item by ID&lt;BR /&gt;item = gis.content.get(item_id)&lt;/P&gt;&lt;P&gt;item_hits = item.usage(date_range= '7D', as_df = True)&lt;BR /&gt;print(item_hits)&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2023 22:43:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/item-usage-not-correctly-getting-requests/m-p/1357752#M69347</guid>
      <dc:creator>ChristopherCounsell</dc:creator>
      <dc:date>2023-12-06T22:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: Item usage not correctly getting requests</title>
      <link>https://community.esri.com/t5/python-questions/item-usage-not-correctly-getting-requests/m-p/1474632#M70610</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;I just upgraded my notebook runtime to ArcGIS Notebook Python 3 Standard - 9.0. Now when I run udf = Item.usage(date_range='6M', as_df=True), it appears to work, but I get&amp;nbsp; the following warning:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2024_05_17_12_04_01_ArcGIS_Online_Item_Audit.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/104491i3E15A29980CD0306/image-size/large?v=v2&amp;amp;px=999" role="button" title="2024_05_17_12_04_01_ArcGIS_Online_Item_Audit.jpg" alt="2024_05_17_12_04_01_ArcGIS_Online_Item_Audit.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;any ideas on how to resolve this, or is this a hope and pray the next update to the python api resolves this? Thank you for everything and have a delightful day.&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;Joe Guzi&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2024 16:05:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/item-usage-not-correctly-getting-requests/m-p/1474632#M70610</guid>
      <dc:creator>JoeGuziStarkCountyOH</dc:creator>
      <dc:date>2024-05-17T16:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: Item usage not correctly getting requests</title>
      <link>https://community.esri.com/t5/python-questions/item-usage-not-correctly-getting-requests/m-p/1476090#M70626</link>
      <description>&lt;P&gt;A quick search indicates that pandas is deprecating datetime. Generally suggests a future update will break it...&lt;/P&gt;&lt;P&gt;It's probably worth a new post and discussion as it's a separate question. This post was specific to a failure/bug which has since been fixed. New question specific to pandas/python/datetime might gather more attention.&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2024 08:07:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/item-usage-not-correctly-getting-requests/m-p/1476090#M70626</guid>
      <dc:creator>ChristopherCounsell</dc:creator>
      <dc:date>2024-05-21T08:07:36Z</dc:date>
    </item>
  </channel>
</rss>

