# How to allow user-agent access to private discourse?

**URL:** https://meta.discourse.org/t/how-to-allow-user-agent-access-to-private-discourse/35537
**Category:** Support
**Created:** [November 13, 2015, 11:49pm UTC](https://meta.discourse.org/t/how-to-allow-user-agent-access-to-private-discourse/35537 "2015-11-13T23:49:55Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [November 15, 2015, 6:48pm UTC](https://meta.discourse.org/t/how-to-allow-user-agent-access-to-private-discourse/35537/8 "2015-11-15T18:48:27Z")

</div>

> [@codinghorror](#):
>
> Do we have any examples of this @techapj?

Yes we do!

* * *

To crawl the topics via Discourse API just provide your API key and username, and the requests made will be authenticated as regular user. For example:

> <https://github.com/discourse/discourse_api/blob/main/examples/example.rb#L9>

To achieve the same via cURL request, pass `api_key` and `api_username` as param. For example:

````plaintext
curl -X GET -d api_key="API_KEY" -d api_username="ADMIN_USERNAME" http://discourse.example.com/latest.json
```

Both of the above examples will fetch all the latest topics (even for private Discourse instance).

@Joey_Tuan for more detailed API documentation, please see this topic:

https://meta.discourse.org/t/discourse-api-documentation/22706?u=techapj
````

---

_[View the full topic](https://meta.discourse.org/t/how-to-allow-user-agent-access-to-private-discourse/35537)._
