Title: Tag rest api
Last modified: December 9, 2017

---

# Tag rest api

 *  [cirpo](https://wordpress.org/support/users/cirpo/)
 * (@cirpo)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/tag-rest-api/)
 * GET `wp/v2/tags` returns a list of tags (20 by default) but there is no information
   about how many tags there are in totals. The only way I found to get all the 
   tags is to issue multiple requests with the page parameter in the query string
   until I get a response with an empty array. Is there any other elegant solution?
 * POST `wp/v2/tags` will return 409 if a tag already exists, but there are no other
   information about the tag itself, like the id:
 *     ```
       {
           "code": "term_exists",
           "message": "A term with the name provided already exists in this taxonomy.",
           "data": {
               "status": 409
           }
       }
       ```
   
 * The GET API only works with id, it doesn’t work passing a tag name. The only 
   way I found to solve this is to prefetch all the tags with ids, store them in
   memory and check if the tag already exists before doing a POST request.
    Again,
   is there any other way, a more efficient one, to solve this issue?
 * Thanks

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Timothy Jacobs](https://wordpress.org/support/users/timothyblynjacobs/)
 * (@timothyblynjacobs)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/tag-rest-api/#post-9766569)
 * The total number of terms matching your request can be found in the `X-WP-Total`
   header. You can also see the number of pages remaining by checking `X-WP-TotalPages`.
 * The term id not being shown was a regression in 4.9. It has been fixed for 5.0
   and is being considered for 4.9.2. You can follow along in the [trac ticket](https://core.trac.wordpress.org/ticket/42597).
 *  Thread Starter [cirpo](https://wordpress.org/support/users/cirpo/)
 * (@cirpo)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/tag-rest-api/#post-9768829)
 * [@timothy](https://wordpress.org/support/users/timothy/) thanks a lot for your
   reply!
 * Is there any way I can help with the API documentation, to avoid other ppl having
   the same issues?
 * Also, do you know what’s the best place to discuss the API design (for example
   the “missing” GET API for tags given the tag name, or having pagination in the
   headers)?
 * I would like to help
 * thanks
 *  [Timothy Jacobs](https://wordpress.org/support/users/timothyblynjacobs/)
 * (@timothyblynjacobs)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/tag-rest-api/#post-9780919)
 * [@cirpo](https://wordpress.org/support/users/cirpo/), no problem, happy to help!
 * The best way would probably be to join the weekly team meetings in slack. We 
   meet every Wednesday at 22:00 UTC in #core-restapi. I think meetings will be 
   resuming after the holidays. So either the 27th of December or 3rd of January.
   If you don’t have a Slack account, you can join here: [https://make.wordpress.org/chat/](https://make.wordpress.org/chat/).
 * Feel free to open a ticket, at [http://core.trac.wordpress.org/](http://core.trac.wordpress.org/)
   to report a bug or suggest an enhancement.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Tag rest api’ is closed to new replies.

## Tags

 * [api](https://wordpress.org/support/topic-tag/api/)
 * [rest](https://wordpress.org/support/topic-tag/rest/)
 * [tags](https://wordpress.org/support/topic-tag/tags/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [Timothy Jacobs](https://wordpress.org/support/users/timothyblynjacobs/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/tag-rest-api/#post-9780919)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
