# Has something changed in the data explorer? Can't get query via API

**URL:** https://meta.discourse.org/t/has-something-changed-in-the-data-explorer-cant-get-query-via-api/398172
**Category:** Support
**Tags:** data-explorer, rest-api
**Created:** [March 11, 2026, 2:33pm UTC](https://meta.discourse.org/t/has-something-changed-in-the-data-explorer-cant-get-query-via-api/398172 "2026-03-11T14:33:52Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [March 11, 2026, 2:33pm UTC](https://meta.discourse.org/t/has-something-changed-in-the-data-explorer-cant-get-query-via-api/398172/1 "2026-03-11T14:33:52Z")

</div>

This stopped working two days ago for a hosted customer:

```plaintext

  HTTP_STATUS=$(curl -s -o /tmp/discourse_response.json -w "%{http_code}" \
    -X POST "https://HOSTNAME/admin/plugins/discourse-data-explorer/queries/3/run" \
    -H "Content-Type: multipart/form-data;" \
    -H "Api-Key: $DISCOURSE_API_KEY" \
    -H "Api-Username: $DISCOURSE_API_USER" \
    -F "limit=ALL")

```

I see successful use of that key:

 ![image](https://global.discourse-cdn.com/meta/original/4X/c/4/2/c423e3f12139ab318fdba8ba0e9e63b406c7ddf4.png)

It has query-only permissions:

 ![image](https://global.discourse-cdn.com/meta/original/4X/b/8/1/b81f2616dfbc9b3caa0034ef462604fb46c3834a.png)

I double-checked that the URL of the query hadn’t changed again by [Reverse engineer the Discourse API](https://meta.discourse.org/t/reverse-engineer-the-discourse-api/20576).

Then I generated a new global key and I’m still getting a 400 error.

I don’t know what the problme could be

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [March 11, 2026, 2:48pm UTC](https://meta.discourse.org/t/has-something-changed-in-the-data-explorer-cant-get-query-via-api/398172/2 "2026-03-11T14:48:06Z")

</div>

> [@pfaffman](#):
>
> I’m still getting a 400 error.

400 or 406 ?

Try adding a `Accept: application/json` header.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [March 11, 2026, 3:15pm UTC](https://meta.discourse.org/t/has-something-changed-in-the-data-explorer-cant-get-query-via-api/398172/3 "2026-03-11T15:15:31Z")

</div>

Wait. I found it:

```plaintext
{"errors":["You supplied invalid parameters to the request: limit"],"error_type":"invalid_parameters"}

```

So the issue is `-F "limit=ALL"`

So now my question is why that stopped working?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [March 11, 2026, 5:26pm UTC](https://meta.discourse.org/t/has-something-changed-in-the-data-explorer-cant-get-query-via-api/398172/4 "2026-03-11T17:26:47Z")

</div>

[https://github.com/discourse/discourse/pull/38320](https://github.com/discourse/discourse/pull/38320)

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [March 11, 2026, 5:29pm UTC](https://meta.discourse.org/t/has-something-changed-in-the-data-explorer-cant-get-query-via-api/398172/5 "2026-03-11T17:29:35Z")

</div>

Thanks very much. But I was unable to use `limit=ALL` even as an admin with a global key. The client needs to download all of the data (I’m currently unclear what the limit is or how large the set is likely to be.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [March 11, 2026, 5:41pm UTC](https://meta.discourse.org/t/has-something-changed-in-the-data-explorer-cant-get-query-via-api/398172/6 "2026-03-11T17:41:23Z")

</div>

> [@pfaffman](#):
>
> But I was unable to use `limit=ALL` even as an admin with a global key.

That is exactly what the PR aimed to do!

> [@pfaffman](#):
>
> The client needs to download all of the data

Options are backups, or doing pagination with

```plaintext
select * from table where id > (:page * 5000)

```

so you get it in chunks for 5k.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [March 11, 2026, 5:42pm UTC](https://meta.discourse.org/t/has-something-changed-in-the-data-explorer-cant-get-query-via-api/398172/7 "2026-03-11T17:42:43Z")

</div>

> [@Falco](#):
>
> That is exactly what the PR aimed to do!

It’s working!

Is the max for a normal query that I’m doing 5000? If so, I’m definitely safe.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [March 11, 2026, 5:43pm UTC](https://meta.discourse.org/t/has-something-changed-in-the-data-explorer-cant-get-query-via-api/398172/8 "2026-03-11T17:43:44Z")

</div>

> [@pfaffman](#):
>
> It’s working!

😆

> [@pfaffman](#):
>
> Is the max for a normal query that I’m doing 5000? If so, I’m definitely safe.

Looks like it is 10k

> <https://github.com/discourse/discourse/blob/main/plugins/discourse-data-explorer/plugin.rb#L30>

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [March 11, 2026, 5:46pm UTC](https://meta.discourse.org/t/has-something-changed-in-the-data-explorer-cant-get-query-via-api/398172/9 "2026-03-11T17:46:37Z")

</div>

Thanks very much. Looks ilke I didn’ t need that no-limit anyway. 🙂

I’ve been very pleased that I figured out how to use Github actions to daily pull this query to upload it to a vendor’s FTP site. It’s broken twice in the past couple of weeks. Hopefully this is the last time for a long while!
