# API is not returning post Name value

**URL:** https://meta.discourse.org/t/api-is-not-returning-post-name-value/360327
**Category:** Development
**Created:** [April 4, 2025, 1:21am UTC](https://meta.discourse.org/t/api-is-not-returning-post-name-value/360327 "2025-04-04T01:21:01Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Jeremy\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jeremy_d/32/497534_2.png) [@Jeremy\_D](https://meta.discourse.org/u/Jeremy_D)
#### Post date: [April 4, 2025, 1:21am UTC](https://meta.discourse.org/t/api-is-not-returning-post-name-value/360327/1 "2025-04-04T01:21:01Z")

</div>

I’m trying to fetch post details via the api, but it appears the response has `null` on the `name` field for all posts I query.

Example trimmed response:

```plaintext
{
    "id": 15,
    "name": null,
    "username": "Jeremy",
    "avatar_template": "/user_avatar/redacted/jeremy/{size}/3_2.png",
    "created_at": "2025-01-28T05:00:56.331Z",
    "cooked": "<p>Placeholder content tbd</p>",
    "post_number": 1,
    "post_type": 1,
    "posts_count": 1,
    "updated_at": "2025-01-28T05:00:56.331Z",

```

There’s another value that I would think might contain the name of the post, `user_title` but that is also `null`. Is there a setting somewhere I’m missing? And yes these posts do in fact have titles.

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [April 4, 2025, 1:51am UTC](https://meta.discourse.org/t/api-is-not-returning-post-name-value/360327/3 "2025-04-04T01:51:07Z")

</div>

Hey, welcome to meta!

The `name` field usually refers to the user’s name. It will be null if no name is defined in your profile (below the username).

Are you looking for the topic title?

---

<div class="post-metadata">

### Author: ![Jeremy\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jeremy_d/32/497534_2.png) [@Jeremy\_D](https://meta.discourse.org/u/Jeremy_D)
#### Post date: [April 4, 2025, 2:00am UTC](https://meta.discourse.org/t/api-is-not-returning-post-name-value/360327/4 "2025-04-04T02:00:52Z")

</div>

Yep, with some extra poking, I was able to decipher how the api (and discourse) is supposed to work hierarchically. So now I’m fetching a single topic and just grabbing the first post in the `post_stream`.

Does `post_stream` return _all_ posts on the topic? Or can I limit it in some way?

---

<div class="post-metadata">

### Author: ![Jeremy\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jeremy_d/32/497534_2.png) [@Jeremy\_D](https://meta.discourse.org/u/Jeremy_D)
#### Post date: [April 4, 2025, 2:02am UTC](https://meta.discourse.org/t/api-is-not-returning-post-name-value/360327/5 "2025-04-04T02:02:33Z")

</div>

My use case is that I have an angular application and I’m trying to pull in Discourse posts to essentially make a pseudo-blog that’s integrated into that application. So far this seems entirely doable.

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [April 4, 2025, 2:15am UTC](https://meta.discourse.org/t/api-is-not-returning-post-name-value/360327/6 "2025-04-04T02:15:59Z")

</div>

`post_stream` → `posts` returns the first 20 posts. You can use `?page=` query.  
`post_stream` → `streams` returns all the topic post IDs.

Additional guide if you want to get specific posts:

> [@Fetch All Posts from a Topic Using the API](https://meta.discourse.org/t/fetch-all-posts-from-a-topic-using-the-api/260886):
>
> notebook_with_decorative_cover This is a how-to guide explaining how to fetch all posts from a topic using the Discourse API The results returned by the Discourse API for many routes are paginated. For example, the API endpoint for [“Get A Single Topic”](https://docs.discourse.org/#tag/Topics/operation/getTopic) - Ex: https://examplesite/t/{id}.json will only return 20 posts by default, even if the topic contains more than 20 posts. Due to this behavior, there are two ways you can use the Discourse API to fetch all posts for a topic using the .../t…

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [May 4, 2025, 2:16am UTC](https://meta.discourse.org/t/api-is-not-returning-post-name-value/360327/7 "2025-05-04T02:16:32Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
