# API Task Power Query Limited to 4000 lines

**URL:** <https://www.dolibarr.org/forum/t/api-task-power-query-limited-to-4000-lines/24437>\
**Category:** Using my Dolibarr\
**Tags:** API\
**Created:** [October 19, 2023, 1:19am UTC](https://www.dolibarr.org/forum/t/api-task-power-query-limited-to-4000-lines/24437 "2023-10-19T01:19:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gsfr](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/g/e36b37/32.png) [@gsfr](https://www.dolibarr.org/forum/u/gsfr)\
**Post date:** [October 19, 2023, 1:19am UTC](https://www.dolibarr.org/forum/t/api-task-power-query-limited-to-4000-lines/24437/1 "2023-10-19T01:19:02Z")

</div>

Using MS Power Query I seem to be limited to receiving no more than 4000 “task” lines through an API. I need to increase the number of lines to 10000+

If I change the query to (noting that for security reasons I have removed the ERP address and DOLAPIKEY)  
=Json.Document(Web.Contents(“[https://erp](https://erp).???.au/api/index.php/tasks?sortfield=t.rowid&sortorder=ASC&limit=10000”, [Headers=[Accept=“application/json”, DOLAPIKEY=

I receive the following error;  
DataSource.Error: Web.Contents failed to get contents from sortfield=t.rowid&sortorder=ASC&limit=10000’ (500): Internal Server Error  
Details:  
DataSourceKind=Web  
DataSourcePath=  
Url=//erp.??.au/api/index.php/tasks?sortfield=t.rowid&sortorder=ASC&limit=10000

Please help with a solution, thanks.

---

<div class="post-metadata">

**Author:** ![ksar](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/ksar/32/514_2.png) [@ksar](https://www.dolibarr.org/forum/u/ksar)\
**Post date:** [October 19, 2023, 4:03am UTC](https://www.dolibarr.org/forum/t/api-task-power-query-limited-to-4000-lines/24437/2 "2023-10-19T04:03:24Z")

</div>

Hello,

Error 500 means PHP error, check your hosting logs

---

<div class="post-metadata">

**Author:** ![gsfr](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/g/e36b37/32.png) [@gsfr](https://www.dolibarr.org/forum/u/gsfr)\
**Post date:** [October 20, 2023, 12:41am UTC](https://www.dolibarr.org/forum/t/api-task-power-query-limited-to-4000-lines/24437/3 "2023-10-20T00:41:36Z")

</div>

Thanks, I will look into it.
