I'm trying to make the Stack Exchange API request using the key provided by Stack Apps. But whenever I try it always throws the below error.

{'error_id': 400, 'error_message': "key doesn't match a known application", 'error_name': 'bad_parameter'}

I'm using the Python requests library to make the requests.

STACKEXCHANGE_ENDPOINT = "https://api.stackexchange.com/"
SIMILAR_ENDPOINT = "/2.2/similar"

params = {
    "key": "<mykeyhere>",
    "order": "desc",
    "sort": "relevance",
    "tagged": "django",
    "site": "stackoverflow",
    "title": self.q,
response = requests.get(endpoint, params=params)

My final URL will be like this:


Can someone tell me why I'm getting that bad_parameter error?


When copying the application key, please keep in mind that the parentheses are actually part of the key, even if they are the only non-alphanumeric characters in it:

enter image description here

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .