# [Get taxonomy by slug](https://github.com/kadamwhite/wordpress-rest-api/issues/95)

> state: **open** opened by: **PanMan** on: **12/11/2014**

In the docs (frontpage) it says:

    wp.taxonomies().taxonomy( &#x27;taxonomy_name&#x27; ).term( termIdentifier ): get the term with slug or ID termIdentifier from the taxonomy taxonomy_name

This works with the ID, but not with the slug :(. Is this something that changed?

HOST/wp-json/taxonomies/post_tag/terms/42 works
HOST/wp-json/taxonomies/post_tag/terms/sociaal-ondernemerschap doesn&#x27;t

### Comments

---
> from: [**kadamwhite**](https://github.com/kadamwhite/wordpress-rest-api/issues/95#issuecomment-66617842) on: **12/11/2014**

This may just have been a mistake on my part, I can&#x27;t find a prior version of the API that did support this—I&#x27;ll look into it today
---
> from: [**kadamwhite**](https://github.com/kadamwhite/wordpress-rest-api/issues/95#issuecomment-66618826) on: **12/11/2014**

This is definitely not supported at present, thank you for the catch. I believe I will add a &#x60;.slug()&#x60; method to the Taxonomies query builder to allow terms to be provided by slug; however, this depends on WP-API/WP-API#347, because the version of the API in the plugin directory does not support filtering taxonomy collection endpoints. I am not sure how to proceed in releasing this feature given that it is not in the officially-released version of the plugin.

What version are you using? You can try this query; in the latest &quot;master&quot; version of the plugin, it will return an array with a single element:
&#x60;&#x60;&#x60;
HOST/wp-json/taxonomies/post_tag/terms?filter[slug]=sociaal-ondernemerschap
&#x60;&#x60;&#x60;
---
> from: [**kadamwhite**](https://github.com/kadamwhite/wordpress-rest-api/issues/95#issuecomment-66618888) on: **12/11/2014**

c.f. update: the actual PR that landed this change was WP-API/WP-API#401, not 347
---
> from: [**PanMan**](https://github.com/kadamwhite/wordpress-rest-api/issues/95#issuecomment-66622116) on: **12/11/2014**

The filter by slug is what I had in my code (and which I think worked last week?), but now it returns all items, and doesn&#x27;t filter.
---
> from: [**kadamwhite**](https://github.com/kadamwhite/wordpress-rest-api/issues/95#issuecomment-66633406) on: **12/11/2014**

What version of the WP-API plugin are you using?
---
> from: [**PanMan**](https://github.com/kadamwhite/wordpress-rest-api/issues/95#issuecomment-66659363) on: **12/11/2014**

The latest stable from wordpress.org, 1.1.1
---
> from: [**kadamwhite**](https://github.com/kadamwhite/wordpress-rest-api/issues/95#issuecomment-66664712) on: **12/11/2014**

That makes sense. Filtering for taxonomy collections is not included in 1.1.1, so there won&#x27;t be any way to get at a specific term until a new plugin version is released; I will add the &#x60;.slug&#x60; convenience method at that point.

The best I can offer is to filter down the returned collection:
&#x60;&#x60;&#x60;js
wp.tags().then(function(tags) {
  return _.findWhere(tags, {
    slug: &#x27;term-slug&#x27;
  });
});
&#x60;&#x60;&#x60;
It is not super efficient to request all terms each time, so you may want to request all of them and cache that collection locally in a variable or an LRU cache to speed up the retrieval.
---
> from: [**PanMan**](https://github.com/kadamwhite/wordpress-rest-api/issues/95#issuecomment-66693239) on: **12/11/2014**

I think I&#x27;ll update the WP-API on the server. Thnx for your input! 
---
> from: [**kadamwhite**](https://github.com/kadamwhite/wordpress-rest-api/issues/95#issuecomment-173453422) on: **1/21/2016**

In the intervening year, this has been broken again by the v2 beta upgrades: WP-API/WP-API#924 identifies that &#x60;filter&#x60; is not currently supported on the &#x60;/categories&#x60; or &#x60;/tags&#x60; endpoints.

WP-API/WP-API#2065 has been opened to identify whether this will ever be reinstated; in the meantime, #126 will add a demonstration of using the &#x60;?search&#x60; parameter to _slightly_ more efficiently retrieve a specific term by slug (basically the same &quot;get them all and search for the one you want in the response&quot; approach detailed above, but with less overhead due to the narrowing effect of &#x60;?search=the-slug&#x60;).
