<?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: 2000 rows limitation with api export json data in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/2000-rows-limitation-with-api-export-json-data/m-p/1481454#M4759</link>
    <description>&lt;P&gt;Came across this limitation myself and found this thread.&amp;nbsp; Used&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/124187"&gt;@Raul_Jimenez&lt;/a&gt;&amp;nbsp;'s reccomendation and used the resultOffset parameter in an ArcPy script.&amp;nbsp; Here is the code if anyone else needs to do something similar.&lt;/P&gt;&lt;P&gt;def Map_Service_Batch_Download(fs_url, batch_size, download_folder, out_fc):&lt;BR /&gt;# Get count of records in feature service and # of download batches needed&lt;BR /&gt;record_cnt = int(str(arcpy.management.GetCount(fs_url)))&lt;BR /&gt;downloads_necessary = math.ceil(record_cnt/batch_size)&lt;/P&gt;&lt;P&gt;# Download .geojson for each batch based on total # of records, 2000 at a time&lt;BR /&gt;for dl_cnt in list(range(downloads_necessary)):&lt;BR /&gt;start_record = dl_cnt*batch_size&lt;BR /&gt;urllib.request.urlretrieve(fs_url + "/query?outFields=*&amp;amp;where=1%3D1&amp;amp;f=geojson&amp;amp;resultOffset=" + str(start_record) + "&amp;amp;resultRecordCount=" + str(batch_size), dl_dir + "Weld_Parcels_DL_" + str(dl_cnt) + ".geojson")&lt;/P&gt;&lt;P&gt;# Loop through all the downloaded .geojsons and load to output feature class&lt;BR /&gt;geojson_cnt = 0&lt;BR /&gt;for geojson in os.listdir(download_folder):&lt;BR /&gt;arcpy.JSONToFeatures_conversion(download_folder + geojson, "memory/parcels_temp", "POLYGON")&lt;BR /&gt;if geojson_cnt == 0:&lt;BR /&gt;arcpy.arcpy.management.CopyFeatures("memory/parcels_temp", out_fc)&lt;BR /&gt;else:&lt;BR /&gt;arcpy.management.Append("memory/parcels_temp", out_fc)&lt;BR /&gt;os.remove(download_folder + geojson)&lt;BR /&gt;geojson_cnt += 1&lt;/P&gt;&lt;P&gt;Map_Service_Batch_Download(weld_parcel_url, 2000, dl_dir, parcels_from_geojson)&lt;/P&gt;</description>
    <pubDate>Thu, 30 May 2024 18:17:57 GMT</pubDate>
    <dc:creator>ArthurSmith</dc:creator>
    <dc:date>2024-05-30T18:17:57Z</dc:date>
    <item>
      <title>2000 rows limitation with api export json data</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/2000-rows-limitation-with-api-export-json-data/m-p/1197822#M4227</link>
      <description>&lt;P&gt;Hi all. My name is Leah, I am working as a data specialist to help my team with reporting and data analysis. We have a GIS partner who built a web app for us. The web app is used for collecting data from offline environments, and it works great with our workflow. We also have a powerBI dashboard to use the data collected from this web app for reporting.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am able to set up the Rest API with auth token to refresh the data from a feature layer, however, I can export 4200 rows from the ArcGIS online (&lt;A target="_blank" rel="noopener"&gt;https://&amp;lt;services-url&amp;gt;/arcgis/rest/services/&amp;lt;layer-name&amp;gt;/FeatureServer/0&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;Only 2000 rows were exported if I use Rest API&amp;nbsp; (&lt;A target="_blank" rel="noopener"&gt;https://&amp;lt;services-url&amp;gt;/arcgis/rest/services/&lt;/A&gt;&lt;A target="_blank" rel="noopener"&gt;&amp;lt;layer-name&amp;gt;&lt;/A&gt;&lt;A target="_blank" rel="noopener"&gt;/FeatureServer/0&lt;/A&gt;&lt;A target="_blank" rel="noopener"&gt;/query?where=1%3D1&amp;amp;outFields=*&amp;amp;returnGeometry=false&amp;amp;resultRecordCount=0&amp;amp;f=json&amp;amp;token=token&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;I followed another post&amp;nbsp;&lt;A title="https://support.esri.com/en/technical-article/000012383" href="https://support.esri.com/en/technical-article/000012383" target="_blank" rel="noopener noreferrer"&gt;https://support.esri.com/en/technical-article/000012383&lt;/A&gt; to change the maxRecordCount to 8000. Even so, I still get only 2000 rows from my export json file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LeahYan_0-1659325228886.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/47355i570ED5B95B01AF0C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LeahYan_0-1659325228886.png" alt="LeahYan_0-1659325228886.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Does anyone have an idea why this would be happening?&amp;nbsp;Is anything I can do to export the entire dataset from a feature layer host on ArcGIS online? If not, is there any workaround for PowreBI data refreshing?&lt;/P&gt;&lt;P&gt;Thanks for the help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 03:43:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/2000-rows-limitation-with-api-export-json-data/m-p/1197822#M4227</guid>
      <dc:creator>LeahYan</dc:creator>
      <dc:date>2022-08-01T03:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: 2000 rows limitation with api export json data</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/2000-rows-limitation-with-api-export-json-data/m-p/1197986#M4228</link>
      <description>&lt;P&gt;Have you read the &lt;A href="https://developers.arcgis.com/rest/services-reference/enterprise/query-feature-service-layer-.htm" target="_blank"&gt;Query (Feature Service/Layer)—ArcGIS REST APIs | ArcGIS Developers&lt;/A&gt; documentation?&amp;nbsp; Specifically, the parts about resultType and max record count?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2022 14:30:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/2000-rows-limitation-with-api-export-json-data/m-p/1197986#M4228</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2022-08-01T14:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: 2000 rows limitation with api export json data</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/2000-rows-limitation-with-api-export-json-data/m-p/1198405#M4229</link>
      <description>&lt;P&gt;I have never been able to increase the maxRecordCount above 2000, but you have two options:&lt;/P&gt;&lt;P&gt;1) Use the "resultOffset" parameter (which is the pagination mechanism): &amp;lt;- &lt;STRONG&gt;this is the one I would recommend&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Raul_Jimenez_1-1659428587690.png" style="width: 646px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/47541i00ABF9ED3689DFF0/image-dimensions/646x210?v=v2" width="646" height="210" role="button" title="Raul_Jimenez_1-1659428587690.png" alt="Raul_Jimenez_1-1659428587690.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2) Use the asynchronous/job "&lt;A href="https://developers.arcgis.com/rest/users-groups-and-items/export-item.htm" target="_self"&gt;https://[root]/content/users/[userName]/export&lt;/A&gt;" endpoint to generate a file.&lt;/P&gt;&lt;P&gt;Another page that you might want to check is the &lt;A href="https://developers.arcgis.com/documentation/mapping-apis-and-services/data-hosting/services/feature-service/" target="_self"&gt;Feature service&lt;/A&gt;&amp;nbsp;page within the "&lt;A href="https://developers.arcgis.com/documentation/mapping-apis-and-services/" target="_self"&gt;Mapping APIs and locations services guide&lt;/A&gt;" (it is a conceptual guide about many of the cross concepts of the ArcGIS system, including the REST APIs).&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2022 08:28:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/2000-rows-limitation-with-api-export-json-data/m-p/1198405#M4229</guid>
      <dc:creator>Raul_Jimenez</dc:creator>
      <dc:date>2022-08-02T08:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: 2000 rows limitation with api export json data</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/2000-rows-limitation-with-api-export-json-data/m-p/1244139#M4335</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/124187"&gt;@Raul_Jimenez&lt;/a&gt;&amp;nbsp;- do you have an example query where you have used the resultOffset option? Below is what I am using right now, but seeing max of 2000 records. I don't see the resultOffset parameter in the &lt;A href="https://developers.arcgis.com/rest/services-reference/enterprise/query-feature-service-.htm" target="_self"&gt;query&lt;/A&gt; documentation so I am wondering if it is supported with this method.&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;(https://&lt;A href="https://services3.arcgis.com/XXXXXXXXXXX/arcgis/rest/services/XXXXXXXXX/FeatureServer/13/query?where=1%3D1&amp;amp;outFields=*&amp;amp;returnGeometry=false&amp;amp;resultRecordCount=0&amp;amp;f=json" target="_blank" rel="noopener"&gt;services3.arcgis.com/XXXXXXXXXXX/arcgis/rest/services/XXXXXXXXX/FeatureServer/13/query?&lt;/A&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;A href="https://services3.arcgis.com/XXXXXXXXXXX/arcgis/rest/services/XXXXXXXXX/FeatureServer/13/query?where=1%3D1&amp;amp;outFields=*&amp;amp;returnGeometry=false&amp;amp;resultRecordCount=0&amp;amp;f=json" target="_blank" rel="noopener"&gt;where=&lt;/A&gt;&lt;A target="_blank" rel="noopener"&gt;%3D&lt;/A&gt;&lt;A href="https://services3.arcgis.com/XXXXXXXXXXX/arcgis/rest/services/XXXXXXXXX/FeatureServer/13/query?where=1%3D1&amp;amp;outFields=*&amp;amp;returnGeometry=false&amp;amp;resultRecordCount=0&amp;amp;f=json" target="_blank" rel="noopener"&gt;&amp;amp;outFields=*&amp;amp;returnGeometry=false&amp;amp;resultRecordCount=0&amp;amp;f=json)&lt;/A&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I am bringing the data into PowerBI if it matters.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 28 Dec 2022 22:58:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/2000-rows-limitation-with-api-export-json-data/m-p/1244139#M4335</guid>
      <dc:creator>AW_Grove</dc:creator>
      <dc:date>2022-12-28T22:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: 2000 rows limitation with api export json data</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/2000-rows-limitation-with-api-export-json-data/m-p/1481454#M4759</link>
      <description>&lt;P&gt;Came across this limitation myself and found this thread.&amp;nbsp; Used&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/124187"&gt;@Raul_Jimenez&lt;/a&gt;&amp;nbsp;'s reccomendation and used the resultOffset parameter in an ArcPy script.&amp;nbsp; Here is the code if anyone else needs to do something similar.&lt;/P&gt;&lt;P&gt;def Map_Service_Batch_Download(fs_url, batch_size, download_folder, out_fc):&lt;BR /&gt;# Get count of records in feature service and # of download batches needed&lt;BR /&gt;record_cnt = int(str(arcpy.management.GetCount(fs_url)))&lt;BR /&gt;downloads_necessary = math.ceil(record_cnt/batch_size)&lt;/P&gt;&lt;P&gt;# Download .geojson for each batch based on total # of records, 2000 at a time&lt;BR /&gt;for dl_cnt in list(range(downloads_necessary)):&lt;BR /&gt;start_record = dl_cnt*batch_size&lt;BR /&gt;urllib.request.urlretrieve(fs_url + "/query?outFields=*&amp;amp;where=1%3D1&amp;amp;f=geojson&amp;amp;resultOffset=" + str(start_record) + "&amp;amp;resultRecordCount=" + str(batch_size), dl_dir + "Weld_Parcels_DL_" + str(dl_cnt) + ".geojson")&lt;/P&gt;&lt;P&gt;# Loop through all the downloaded .geojsons and load to output feature class&lt;BR /&gt;geojson_cnt = 0&lt;BR /&gt;for geojson in os.listdir(download_folder):&lt;BR /&gt;arcpy.JSONToFeatures_conversion(download_folder + geojson, "memory/parcels_temp", "POLYGON")&lt;BR /&gt;if geojson_cnt == 0:&lt;BR /&gt;arcpy.arcpy.management.CopyFeatures("memory/parcels_temp", out_fc)&lt;BR /&gt;else:&lt;BR /&gt;arcpy.management.Append("memory/parcels_temp", out_fc)&lt;BR /&gt;os.remove(download_folder + geojson)&lt;BR /&gt;geojson_cnt += 1&lt;/P&gt;&lt;P&gt;Map_Service_Batch_Download(weld_parcel_url, 2000, dl_dir, parcels_from_geojson)&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 18:17:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/2000-rows-limitation-with-api-export-json-data/m-p/1481454#M4759</guid>
      <dc:creator>ArthurSmith</dc:creator>
      <dc:date>2024-05-30T18:17:57Z</dc:date>
    </item>
  </channel>
</rss>

