pushshift / api

Pushshift API
1.3k stars 111 forks source link

Querying submissions for banned sub-reddits #140

Open aaronsnoswell opened 1 year ago

aaronsnoswell commented 1 year ago

Hello!

I am interested in retrieving submissions and comments for several sub-reddits which have been banned. E.g. r/Incels and r/BrainCels. I noticed that, while the comment queries seem to work, submission queries for these subreddits seem to return empty result responses;

api.pushshift.io/reddit/search/submission?subreddit=incels&size=2 ->

{
  "data": [],
  "error": null,
  "metadata": {
    "es": {
      "took": 91,
      "timed_out": false,
      "_shards": {
        "total": 10,
        "successful": 10,
        "skipped": 0,
        "failed": 0
      },
      "hits": {
        "total": {
          "value": 0,
          "relation": "eq"
        },
        "max_score": null
      }
    },
    "es_query": {
      "size": 2,
      "query": {
        "bool": {
          "must": [
            {
              "bool": {
                "must": []
              }
            },
            {
              "bool": {
                "should": [
                  {
                    "match": {
                      "subreddit": "incels"
                    }
                  }
                ],
                "minimum_should_match": 1
              }
            }
          ]
        }
      },
      "aggs": {},
      "sort": {
        "created_utc": "desc"
      }
    },
    "es_query2": "{\"size\":2,\"query\":{\"bool\":{\"must\":[{\"bool\":{\"must\":[]}},{\"bool\":{\"should\":[{\"match\":{\"subreddit\":\"incels\"}}],\"minimum_should_match\":1}}]}},\"aggs\":{},\"sort\":{\"created_utc\":\"desc\"}}"
  }
}

I'm presently downloading one of the submission .zst files to check if the raw data is actually present or not, but I'd love to know if there is there any way to access the submissions for banned sub-reddits via the API? I've tried limiting the search query to the pre-banned time with &before=2087d but this doesn't seem to change the returned result.

Thanks in advance, and thank you for the excellent resource and your work maintaining it.