# I cannot figure out how to list what author wrote a blog post

**URL:** <https://forum.ghost.org/t/i-cannot-figure-out-how-to-list-what-author-wrote-a-blog-post/35304>\
**Category:** Integrations & API\
**Created:** [January 5, 2023, 7:11pm UTC](https://forum.ghost.org/t/i-cannot-figure-out-how-to-list-what-author-wrote-a-blog-post/35304 "2023-01-05T19:11:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexavier\_Brink](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/alexavier_brink/32/20680_2.png) [@Alexavier\_Brink](https://forum.ghost.org/u/Alexavier_Brink)\
**Post date:** [January 5, 2023, 7:11pm UTC](https://forum.ghost.org/t/i-cannot-figure-out-how-to-list-what-author-wrote-a-blog-post/35304/1 "2023-01-05T19:11:07Z")

</div>

Hey there, I’m trying to use Ghost as a backend and Nextjs as a frontend. I have got the post to display, but I can’t display the author name. Does anyone know how to do that?

---

<div class="post-metadata">

**Author:** ![RyanF](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/ryanf/32/17448_2.png) [@RyanF](https://forum.ghost.org/u/RyanF)\
**Post date:** [January 5, 2023, 7:17pm UTC](https://forum.ghost.org/t/i-cannot-figure-out-how-to-list-what-author-wrote-a-blog-post/35304/2 "2023-01-05T19:17:40Z")

</div>

The most common gotcha when fetching posts from the Content API is not using the [include](https://ghost.org/docs/content-api/#include) parameter to request related data such as tags and authors. By default, the response for a post will not include this data.

What does your API call look like?

---

<div class="post-metadata">

**Author:** ![Alexavier\_Brink](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/alexavier_brink/32/20680_2.png) [@Alexavier\_Brink](https://forum.ghost.org/u/Alexavier_Brink)\
**Post date:** [January 5, 2023, 7:28pm UTC](https://forum.ghost.org/t/i-cannot-figure-out-how-to-list-what-author-wrote-a-blog-post/35304/3 "2023-01-05T19:28:48Z")

</div>

this is what it looks like

```auto
import GhostContentAPI from "@tryghost/content-api";

// Create API instance with site credentials
const api = new GhostContentAPI({
  url: 'Redacted',
  key: 'Redacted
  version: "v5.0"
});

export async function getPosts() {
    return await api.posts
      .browse({
        include: "tag,authors",
        limit: "all"
      })
      .catch(err => {
        console.error(err);
      });
  }

  export async function getSinglePost(postSlug) {
    return await api.posts
      .read({
        slug: postSlug
      })
      .catch(err => {
        console.error(err);
      });
  }

```

---

<div class="post-metadata">

**Author:** ![RyanF](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/ryanf/32/17448_2.png) [@RyanF](https://forum.ghost.org/u/RyanF)\
**Post date:** [January 5, 2023, 10:42pm UTC](https://forum.ghost.org/t/i-cannot-figure-out-how-to-list-what-author-wrote-a-blog-post/35304/4 "2023-01-05T22:42:21Z")

</div>

On your `getPosts` function, you should have `tags` plural.

You’ll also need to have the `include: "tags,authors"` on your `getSinglePost` function. Otherwise, author data won’t be returned.

With those in place you should receive tag and author data from the API call.

---

<div class="post-metadata">

**Author:** ![Alexavier\_Brink](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/alexavier_brink/32/20680_2.png) [@Alexavier\_Brink](https://forum.ghost.org/u/Alexavier_Brink)\
**Post date:** [January 5, 2023, 11:48pm UTC](https://forum.ghost.org/t/i-cannot-figure-out-how-to-list-what-author-wrote-a-blog-post/35304/5 "2023-01-05T23:48:16Z")

</div>

Like this?

```auto
export async function getPosts() {
    return await api.posts
      .browse({
        include: "tags,authors",
        limit: "all"
      })
      .catch(err => {
        console.error(err);
      });
  }

  export async function getSinglePost(postSlug) {
    return await api.posts
      .read({
        include: "tags,authors",
        slug: postSlug
      })
      .catch(err => {
        console.error(err);
      });
  }

```
