# 在 JSON 搜索结果中显示 image\_url

**URL:** https://meta.discourse.org/t/display-image-url-in-the-json-search-results/171605
**Category:** Support
**Created:** [2020年十一月29日 04:04 UTC](https://meta.discourse.org/t/display-image-url-in-the-json-search-results/171605 "2020-11-29T04:04:20Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)
#### Post date: [2020年十一月30日 06:38 UTC](https://meta.discourse.org/t/display-image-url-in-the-json-search-results/171605/3 "2020-11-30T06:38:40Z")

</div>

嘿 @Bcat

你看到这个了吗？

> [@Single topic API endpoint should contain \`image\_url\`](https://meta.discourse.org/t/single-topic-api-endpoint-should-contain-image-url/131020):
>
> When you fetch a list of all topics with a certain tag (e.g. [https://meta.discourse.org/tags/ui.json](https://meta.discourse.org/tags/ui.json)), each topic contains an image\_url field. If you fetch, however, only one topic (e.g. [https://meta.discourse.org/t/37245.json](https://meta.discourse.org/t/37245.json)) it does not contain an image\_url field. This is kind of inconsistent and it would help me a lot if it was available. Can you maybe add it? My workaround for the time being is: response.image\_url = (response.post\_stream.posts[0].cooked .match(/src=\"(.+?)\"/) || [])[1]…

---

_[View the full topic](https://meta.discourse.org/t/display-image-url-in-the-json-search-results/171605)._
