惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
V2EX
IT之家
IT之家
博客园 - 叶小钗
雷峰网
雷峰网
T
Tailwind CSS Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
SegmentFault 最新的问题
Apple Machine Learning Research
Apple Machine Learning Research
爱范儿
爱范儿
博客园 - 【当耐特】
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
大猫的无限游戏
大猫的无限游戏
Last Week in AI
Last Week in AI
月光博客
月光博客
酷 壳 – CoolShell
酷 壳 – CoolShell
Jina AI
Jina AI
博客园 - Franky
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
宝玉的分享
宝玉的分享
阮一峰的网络日志
阮一峰的网络日志
Hugging Face - Blog
Hugging Face - Blog
博客园 - 司徒正美

Discourse Meta - Latest posts

Horizon: High Context Topic Cards I'd like to ask what this file /var/www/discourse/vendor/data/RT_sRGB.icm is used for? Discourse to Markdown Plugin Testing reply function How to verify a subdomain (mysite.discourse.group) in Google Search Console? Reader Mode Publishing WordPress gallery posts on Discourse Discourse User Feedback New user filter by custom field and contact Why we can't type the assignee in the search of a post to assign - home screen app Redis Flushall Category-toggled one-touch move post Some sort of variable to eliminate duplicate text? Why did this plugin replacement fail? Add user to list modal often appears above the mobile viewport sceen Creating/Editing a post on mobile: let's discuss the 2026 Discourse experience Wp-discourse feature request - do not show comments with specific tag? Are there any good Chinese plugins? Discourse ID and 2FA Discourse MCP is here! Sample Forum to See Admin Features? I am unable to register for a free Discourse site Wikipedia Lookup Add text for /login (like js.create_account.disclaimer for /signup) How can i set disable Markdown & Default to Rich Text What's the background image size for the Welcome Banner? How do I enable Associated Accounts with 2FA? Hamburger toggle Support <span data-attribute> in the rich editor Cannot disable read-only mode on Free Plan
Interact with discourse from Python?
@Moin · 2026-04-19 · via Discourse Meta - Latest posts

March 4, 2026, 10:02pm 21

Thank you so much! Yes I’ll do this! I’m specifically looking for pageviews (logged in users, anonymous users, crawlers) but I can’t find it in the API documentation. Any pointers?

supermathie (Michael Brown) March 4, 2026, 10:24pm 22

Some of the admin-specific calls aren’t in the API docs

I would open the network tab, go to the admin page, view the report with the data you want to retrieve, and then check the network tab to see what the browser loaded.

Which is really a summary of Reverse engineer the Discourse API

pfaffman (Jay Pfaffman) March 5, 2026, 1:04am 23

What I would do is use the data explorer plugin to get whatever you want and then you can pull that down with the API. Run Data Explorer queries with the Discourse API

supermathie (Michael Brown) March 5, 2026, 1:20am 24

Absolutely; if you want data differing from what’s already on offer in the admin panel, DE is the way to go.

It also gives the guarantee those queries won’t return different data after an update, BUT also the underlying structures may change and you may need to maintain the query.

Tradeoffs either way.

remidm (Rémi Delaporte-Mathurin) March 5, 2026, 1:35pm 25

Thank you both! I got away with the “reverse engineer" method + API key! Thank you so much!

MaukWM (MaukWM) April 19, 2026, 11:38am 26

A bit late to this conversation (well, the extension of it :p), but I also wanted to pull data from a discourse forum and didn’t want the hassle of setting up an API key, if you (or anyone) wants a simple wrapper to pull posts from any discourse forum you can check it our here

Released on PyPi so easy to install with pip/uv, handles rate limiting for you and is typed with Pydantic (makes for a better DX imo). Usage:

from discourse_reader import DiscourseClient

client = DiscourseClient("https://meta.discourse.org")

# Browse categories
for cat in client.categories():
    print(f"{cat.name}: {cat.topic_count} topics")

# Get a topic with all its posts
topic = client.topics.get(12345)
print(topic.title)
print(topic.opening_post.cooked)       # the original post (HTML)
print(topic.accepted_answer)           # accepted answer or None
for reply in topic.posts.replies():
    print(reply.username, reply.cooked)

Not as extensive as pydiscoursebut that’s intentional since it works without an API key, it also definitely won’t offer better or faster data than the data explorer plugin but I think it’s nice if you just wanna quickly pull a batch of threads of simple site statistics :slight_smile:

Moin April 19, 2026, 12:04pm 27

I get the impression that this approach violates the terms of service for this forum and the default terms of service for Discourse forums.

You may not automate access to the forum, or monitor the forum, such as with a web crawler, browser plug-in or add-on, or other computer program that is not a web browser. You may crawl the forum to index it for a publicly available search engine, if you run one.