# מחפש קישורי תמונות בדיונים

**URL:** https://meta.discourse.org/t/searching-for-image-urls-in-topics/346912
**Category:** Support
**Created:** [13 בינואר,‏ 2025,‏ 6:04pm UTC](https://meta.discourse.org/t/searching-for-image-urls-in-topics/346912 "2025-01-13T18:04:22Z")
**Posts on this page:** 1
**Showing post:** 9

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [14 בינואר,‏ 2025,‏ 10:58am UTC](https://meta.discourse.org/t/searching-for-image-urls-in-topics/346912/9 "2025-01-14T10:58:05Z")

</div>

> [@popey](#):
>
> I haven’t requested an API key (bureaucracy), and I wasn’t aware that I’d need one to do what I perceived as a “simple” search query.

You don’t need an API key to do searches.

I’m not sure having an API key could help you resolve your issue more easily.

Here’s an 🤖 example Python script that loops my posts (1 post every 3 sec) on meta and returns those having the substring `upload://` in the raw content:

```py
import requests
import time

def fetch_posts(page):
    url = f"https://meta.discourse.org/search.json?q=%40cocoquark&page={page}"
    response = requests.get(url)
    return response.json()

def fetch_post_content(post_id):
    url = f"https://meta.discourse.org/posts/{post_id}/raw"
    response = requests.get(url)
    return response.text

def process_posts():
    page = 1
    while True:
        print(f"page {page}")
        data = fetch_posts(page)
        
        for post in data['posts']:
            content = fetch_post_content(post['id'])
            if "upload://" in content:
                print("https://meta.discourse.org/posts/" + str(post['id']))
            time.sleep(3)        
        
        if len(data['posts']) < 50:
            print("No more results.")
            break
        
        page += 1

if __name__ == " __main__":
    process_posts()

```

> **Output**
>
> ```plaintext
> page 1
> https://meta.discourse.org/posts/1682015
> https://meta.discourse.org/posts/1677389
> https://meta.discourse.org/posts/1679834
> https://meta.discourse.org/posts/1678673
> https://meta.discourse.org/posts/1679833
> https://meta.discourse.org/posts/1678629
> https://meta.discourse.org/posts/1678229
> https://meta.discourse.org/posts/1676531
> https://meta.discourse.org/posts/1674982
> https://meta.discourse.org/posts/1670250
> https://meta.discourse.org/posts/1674421
> https://meta.discourse.org/posts/1671959
> https://meta.discourse.org/posts/1674355
> https://meta.discourse.org/posts/1673357
> https://meta.discourse.org/posts/1669322
> https://meta.discourse.org/posts/1665519
> page 2
> https://meta.discourse.org/posts/1674153
> https://meta.discourse.org/posts/1670613
> https://meta.discourse.org/posts/1666606
> https://meta.discourse.org/posts/1674992
> https://meta.discourse.org/posts/1672811
> https://meta.discourse.org/posts/1672050
> https://meta.discourse.org/posts/1686260
> https://meta.discourse.org/posts/1684497
> https://meta.discourse.org/posts/1680692
> https://meta.discourse.org/posts/1675012
> page 3
> No more results.
> 
> ```

---

_[View the full topic](https://meta.discourse.org/t/searching-for-image-urls-in-topics/346912)._
