pushshift / api

Pushshift API
1.3k stars 111 forks source link

Comma-delimited parameters improperly handle percent encoding #118

Open quantatic opened 2 years ago

quantatic commented 2 years ago

Consider the following request: https://api.pushshift.io/reddit/search/comment/?q=science&fields=score,score_hidden.

I get the following response:

{
    "data": [
        {
            "score": 1,
            "score_hidden": true
        },
        {
            "score": 1,
            "score_hidden": true
        },
        {
            "score": 1,
            "score_hidden": false
        },
        {
            "score": 1,
            "score_hidden": false
        },
        {
            "score": 1,
            "score_hidden": false
        },
        {
            "score": 1,
            "score_hidden": true
        },
        {
            "score": 1,
            "score_hidden": false
        },
        {
            "score": 1,
            "score_hidden": true
        },
        {
            "score": 1,
            "score_hidden": true
        },
        {
            "score": 1,
            "score_hidden": true
        },
        {
            "score": 1,
            "score_hidden": true
        },
        {
            "score": 1,
            "score_hidden": true
        },
        {
            "score": 1,
            "score_hidden": false
        },
        {
            "score": 1,
            "score_hidden": true
        },
        {
            "score": 1,
            "score_hidden": true
        },
        {
            "score": 1,
            "score_hidden": false
        },
        {
            "score": 1,
            "score_hidden": false
        },
        {
            "score": 1,
            "score_hidden": true
        },
        {
            "score": 1,
            "score_hidden": true
        },
        {
            "score": 1,
            "score_hidden": true
        },
        {
            "score": 1,
            "score_hidden": false
        },
        {
            "score": 1,
            "score_hidden": true
        },
        {
            "score": 1,
            "score_hidden": true
        },
        {
            "score": 1,
            "score_hidden": true
        }
    ]
}

Now, consider the following request: https://api.pushshift.io/reddit/search/comment/?q=science&fields=score%2Cscore_hidden. I expect this request to be effectively identical, but the backend doesn't seem to handle the percent-encoded comma correctly:

{
    "data": [
        {},
        {},
        {},
        {},
        {},
        {},
        {},
        {},
        {},
        {},
        {},
        {},
        {},
        {},
        {},
        {},
        {},
        {},
        {},
        {},
        {},
        {},
        {},
        {}
    ]
}
gety9 commented 1 year ago

@quantatic is fields still working for you? (using ,), it gets ignored on my side.