Skip to content

API for tags has issues #923

@RamRS

Description

@RamRS

I see two issues with the API for tags. One is minor/cosmetic and the other seems to be major.

MINOR: Documentation on API page is problematic:

API page screenshot

See the code segment under "Given" (the URL to the right). It shows a localhost URL which should be changed to https://www.biostars.org/api.... Also, the path to the tags.txt file specified is on Natay's Desktop, which should be masked/redacted. Third, the API doc says there's a parameter called months but the code block shows trange, not months. Fourth, showing the contents of tags.txt might be helpful.

MAJOR: The tags API does not work as advertised. The months parameter is useless and the trange parameter shown doesn't seem to acknowledge any value either. See demo below:

$ cat tags.txt
bash
R

$ curl -X POST -F "tags=@${PWD}/tags.txt" https://www.biostars.org/api/tags/list/\?trange=year
{
    "bash": {
        "answer_count": 61,
        "comment_count": 75,
        "total": 91
    },
    "r": {
        "answer_count": 502,
        "comment_count": 678,
        "total": 926
    }
}

$ curl -X POST -F "tags=@${PWD}/tags.txt" https://www.biostars.org/api/tags/list/\?months=1
{
    "bash": {
        "answer_count": 61,
        "comment_count": 75,
        "total": 91
    },
    "r": {
        "answer_count": 502,
        "comment_count": 678,
        "total": 926
    }
}

$ curl -X POST -F "tags=@${PWD}/tags.txt" https://www.biostars.org/api/tags/list/\?trange=day
{
    "bash": {
        "answer_count": 61,
        "comment_count": 75,
        "total": 91
    },
    "r": {
        "answer_count": 502,
        "comment_count": 678,
        "total": 926
    }
}

$ curl -X POST -F "tags=@${PWD}/tags.txt" https://www.biostars.org/api/tags/list/\?trange=month
{
    "bash": {
        "answer_count": 61,
        "comment_count": 75,
        "total": 91
    },
    "r": {
        "answer_count": 502,
        "comment_count": 678,
        "total": 926
    }
}

The counts do not change, so the parameter is either not checked or not used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions