# Can you get a post preview through API?

**URL:** https://meta.discourse.org/t/can-you-get-a-post-preview-through-api/225366
**Category:** Development
**Tags:** rest-api
**Created:** [April 26, 2022, 8:59pm UTC](https://meta.discourse.org/t/can-you-get-a-post-preview-through-api/225366 "2022-04-26T20:59:42Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Allen\_Chen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/allen_chen/32/256627_2.png) [@Allen\_Chen](https://meta.discourse.org/u/Allen_Chen)
#### Post date: [April 26, 2022, 8:59pm UTC](https://meta.discourse.org/t/can-you-get-a-post-preview-through-api/225366/1 "2022-04-26T20:59:42Z")

</div>

I’m trying to get a preview of each topic through the discourse API so that each topic has a small preview and then a read more…

Through the API I couldn’t find anything that could help me get the preview of a specific topic

---

<div class="post-metadata">

### Author: ![Simon\_Manning](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon_manning/32/198596_2.png) [@Simon\_Manning](https://meta.discourse.org/u/Simon_Manning)
#### Post date: [April 26, 2022, 9:38pm UTC](https://meta.discourse.org/t/can-you-get-a-post-preview-through-api/225366/2 "2022-04-26T21:38:59Z")

</div>

I’m unclear if you’re referring to the API for external applications, e.g. to present these previews on another website, or the APIs available to plugins.

If it’s the former, I can’t see anything directly in the API but you would be able to get a topic, get its first post, get that post’s cooked content and then probably use some library to create an excerpt from that.

If it’s the latter, the `discourse-tooltips` plugin does that for its tooltips so you can take a look at that to see how it’s done. Specifically, this is where it generates excerpts for topics:

> <https://github.com/discourse/discourse-tooltips/blob/7a2cb8b1e288401ab10f0c988d20364989c9d6c6/app/controllers/discourse_tooltips/tooltip_previews_controller.rb#L17-L23>

---

<div class="post-metadata">

### Author: ![Allen\_Chen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/allen_chen/32/256627_2.png) [@Allen\_Chen](https://meta.discourse.org/u/Allen_Chen)
#### Post date: [April 27, 2022, 12:37pm UTC](https://meta.discourse.org/t/can-you-get-a-post-preview-through-api/225366/3 "2022-04-27T12:37:24Z")

</div>

but if it is in a list of posts how would you get each post individually?
