WP Rest API vs - how can I get author information from v2 - the author ID? WP Rest API vs - how can I get author information from v2 - the author ID? json json

WP Rest API vs - how can I get author information from v2 - the author ID?


Append the query parameter _embed in your API URL

Embedding is triggered by setting the _embed query parameter on the request. This will then include embedded resources under the _embedded key adjacent to the _links key in JSON file... as showed in http://v2.wp-api.org/reference/links.html

Examples:

http://demo.wp-api.org/wp-json/wp/v2/posts?_embedhttp://demo.wp-api.org/wp-json/wp/v2/posts?filter%5Bposts_per_page%5D=10&page=1&_embed

Getting Author Name from JSON, and showing:

{{postItem._embedded.author[0].name}}

Getting Featured Image:

{{postItem._embedded['wp:featuredmedia'][0].source_url}}

Categories:

{{postItem._embedded['wp:term'][0][0].slug}}{{postItem._embedded['wp:term'][0][1].slug}}{{postItem._embedded['wp:term'][0][2].slug}}{{postItem._embedded['wp:term'][0][3].slug}}...

and Tags:

{{postItem._embedded['wp:term'][1][1].slug}}{{postItem._embedded['wp:term'][1][2].slug}}...


I think what you want is /wp-json/wp/v2/users/1

You should also find the direct url at _links > author > href

enter image description here