# Add JSON for /tags

**URL:** https://meta.discourse.org/t/add-json-for-tags/29485
**Category:** Feature
**Created:** [May 31, 2015, 9:05pm UTC](https://meta.discourse.org/t/add-json-for-tags/29485 "2015-05-31T21:05:00Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![johnmuhl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johnmuhl/32/43413_2.png) [@johnmuhl](https://meta.discourse.org/u/johnmuhl)
#### Post date: [May 31, 2015, 9:05pm UTC](https://meta.discourse.org/t/add-json-for-tags/29485/1 "2015-05-31T21:05:00Z")

</div>

Could a JSON representation be added for [`/tags`](https://meta.discourse.org/tags.json)?

---

<div class="post-metadata">

### Author: ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)
#### Post date: [May 31, 2015, 9:14pm UTC](https://meta.discourse.org/t/add-json-for-tags/29485/2 "2015-05-31T21:14:41Z")

</div>

Requesting with the following HTTP header returns JSON:  
`X-Requested-With: XMLHttpRequest`

You can try it for yourself with CURL:

```bash
curl "https://meta.discourse.org/tags" -H "X-Requested-With: XMLHttpRequest"

```

Although supporting the “.json” extension would make it the same as many other endpoints.

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [June 1, 2015, 3:00pm UTC](https://meta.discourse.org/t/add-json-for-tags/29485/3 "2015-06-01T15:00:51Z")

</div>

> [@DeanMarkTaylor](#):
>
> Although supporting the “.json” extension would make it the same as many other endpoints.

Tags can now have periods in them so that’s unfortunately not going to happen.

We lose a little discoverability but on the other hand only developers really want the JSON feeds and they can figure it out easily!

---

<div class="post-metadata">

### Author: ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)
#### Post date: [June 1, 2015, 5:58pm UTC](https://meta.discourse.org/t/add-json-for-tags/29485/4 "2015-06-01T17:58:12Z")

</div>

> [@eviltrout](#):
>
> Tags can now have periods in them so that’s unfortunately not going to happen.

Ahh, got ya - that does make it awkward.

Thanks for clarifying the reasoning.

Could you confirm that adding the “`X-Requested-With: XMLHttpRequest`” header is the correct (best) way to force JSON request?

It doesn’t seem quite specific enough - it feels like we should be requesting JSON rather than making adding the fake `X-Requested-With` header.

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [June 2, 2015, 6:48pm UTC](https://meta.discourse.org/t/add-json-for-tags/29485/5 "2015-06-02T18:48:39Z")

</div>

Actually we support the `Accept` header, so this approach is preferred as our API needn’t be consumed by XHR:

```plaintext
curl "https://meta.discourse.org/tags" -H "Accept: application/json"

```

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [December 4, 2025, 11:35am UTC](https://meta.discourse.org/t/add-json-for-tags/29485/6 "2025-12-04T11:35:58Z")

</div>


