# JSON API enpoints for Taxonomy Terms

**URL:** <https://discourse.gohugo.io/t/json-api-enpoints-for-taxonomy-terms/24592>\
**Category:** support\
**Created:** [April 9, 2020, 9:56pm UTC](https://discourse.gohugo.io/t/json-api-enpoints-for-taxonomy-terms/24592 "2020-04-09T21:56:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeremyzilar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jeremyzilar/32/3423_2.png) [@jeremyzilar](https://discourse.gohugo.io/u/jeremyzilar)\
**Post date:** [April 9, 2020, 9:56pm UTC](https://discourse.gohugo.io/t/json-api-enpoints-for-taxonomy-terms/24592/1 "2020-04-09T21:56:58Z")

</div>

**Q.** Has there been work on providing support for taxonomy terms as JSON as part of HUGO?

I ask because we experience a lot of issues around the way our terms API templates are currently set up, and before I dive into refactoring these to improve how I am checking for data, I’d like to see if an out-of-the-box method has been developed in the last few years.

### For background — here is what we have now

A while back, I implemented terms APIs for our “topics” and “authors” on [Digital.gov](http://Digital.gov), based on the work that @regis talked about in his post from 2018 [https://forestry.io/blog/build-a-json-api-with-hugo/](https://forestry.io/blog/build-a-json-api-with-hugo/) and in the Part 2 [https://forestry.io/blog/hugo-json-api-part-2/](https://forestry.io/blog/hugo-json-api-part-2/) 🎉

In short, we’re storing the templates for the JSON files as shortcodes, like this:

- Authors: [https://github.com/GSA/digitalgov.gov/blob/master/themes/digital.gov/layouts/shortcodes/api-authors.html](https://github.com/GSA/digitalgov.gov/blob/master/themes/digital.gov/layouts/shortcodes/api-authors.html)
- Topics: [https://github.com/GSA/digitalgov.gov/blob/master/themes/digital.gov/layouts/shortcodes/api-topics.html](https://github.com/GSA/digitalgov.gov/blob/master/themes/digital.gov/layouts/shortcodes/api-topics.html)

Which are producing these outputs:

- [https://digital.gov/authors/v1/json/](https://digital.gov/authors/v1/json/)
- [https://digital.gov/topics/v1/json/](https://digital.gov/topics/v1/json/)

---

<div class="post-metadata">

**Author:** ![pointyfar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/pointyfar/32/5797_2.png) [@pointyfar](https://discourse.gohugo.io/u/pointyfar)\
**Post date:** [April 10, 2020, 12:39am UTC](https://discourse.gohugo.io/t/json-api-enpoints-for-taxonomy-terms/24592/2 "2020-04-10T00:39:44Z")

</div>

I’m not sure I understand the question?

1. You can configure Hugo to output `json` for taxonomy / terms / etc
2. You can define custom layouts for Hugo to use to output `json`. What you include there is up to you.
3. Instead of shortcodes, why not use custom layouts?

---

<div class="post-metadata">

**Author:** ![regis](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/regis/32/4958_2.png) [@regis](https://discourse.gohugo.io/u/regis)\
**Post date:** [April 10, 2020, 2:03pm UTC](https://discourse.gohugo.io/t/json-api-enpoints-for-taxonomy-terms/24592/3 "2020-04-10T14:03:35Z")

</div>

@jeremyzilar I wrote a Hugo theme/component which might help you better. I’d love for you to try it, and would be able to help from there. I need to make it a full fledge Hugo Module some time soon but in the mean time it works great as a regular theme.

> **[regisphilibert/juliette-hugo-component](https://github.com/regisphilibert/juliette-hugo-component)**
>
> Juliette is a Hugo API Theme Component. Contribute to regisphilibert/juliette-hugo-component development by creating an account on GitHub.

Thanks.

---

<div class="post-metadata">

**Author:** ![jeremyzilar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jeremyzilar/32/3423_2.png) [@jeremyzilar](https://discourse.gohugo.io/u/jeremyzilar)\
**Post date:** [April 13, 2020, 10:10pm UTC](https://discourse.gohugo.io/t/json-api-enpoints-for-taxonomy-terms/24592/4 "2020-04-13T22:10:19Z")

</div>

Oooh, happy to give this a try now, thank you @regis!
