You can use the advanced search:
https://meta.discourse.org/search?q=filetype%3Apdf%20%23support
(searches for filetype:pdf #support)
Routes on Discourse have a JSON serializer, so you can tweak the search and then use /search.json?q=your-query.