# What would be the best way to display the last topics excerpts and categories via the API?

**URL:** https://meta.discourse.org/t/what-would-be-the-best-way-to-display-the-last-topics-excerpts-and-categories-via-the-api/77061
**Category:** Support
**Created:** [2018 年1 月 1 日 16:30 UTC](https://meta.discourse.org/t/what-would-be-the-best-way-to-display-the-last-topics-excerpts-and-categories-via-the-api/77061 "2018-01-01T16:30:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### 作者： ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### 发布日期： [2018 年1 月 1 日 16:30 UTC](https://meta.discourse.org/t/what-would-be-the-best-way-to-display-the-last-topics-excerpts-and-categories-via-the-api/77061/1 "2018-01-01T16:30:46Z")

</div>

Greeting.  
I’m looking to display the last topics of my Discourse forum on a Wordpress website.  
I’ve made a WP plugin which grabs /latest.json data and displays them to my WP users in a widget.

However, besides the title, view/reply counts and most active posters, I’d like to display an excerpt from every topic as well as their category.

I need another request for the categories, but what about the excerpts? Should I do one additional API request for **every** topic in order to make an excerpt?

If I want to display the 5 last topics with an excerpt and the category, that would be like 7 requests? Do you think that would slow significantly the WP page loading?

---

<div class="post-metadata">

### 作者： ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### 发布日期： [2018 年1 月 1 日 18:08 UTC](https://meta.discourse.org/t/what-would-be-the-best-way-to-display-the-last-topics-excerpts-and-categories-via-the-api/77061/2 "2018-01-01T18:08:31Z")

</div>

> [@hanks](#):
>
> I need another request for the categories, but what about the excerpts? Should I do one additional API request for every topic in order to make an excerpt?

You can save the Discourse category data on WordPress so that you don’t have to keep requesting it. The same idea works for excerpts. Once you have the excerpt for a topic on WordPress, you shouldn’t need to fetch it again from Discourse.

---

<div class="post-metadata">

### 作者： ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### 发布日期： [2024 年2 月 25 日 19:41 UTC](https://meta.discourse.org/t/what-would-be-the-best-way-to-display-the-last-topics-excerpts-and-categories-via-the-api/77061/5 "2024-02-25T19:41:36Z")

</div>


