I have an Elevated Developer account. I am attempting to utilize API 2.0’s filtered stream functionality in Python. I’ve followed the documentation, I can create rules and confirm they have been created on the server. However, when attempting to stream with Python’s requests library, I get the following error which persists: Your subscription change is currently being provisioned, please try again in a minute. Can anyone offer any insight? Code for my Python function is below. Thank you.

def start_stream():
    stream = requests.Session()
    response = stream.get(base_stream_url, headers=rule_header, stream=True)
    if response.status_code != 200:
        raise Exception('Cannot Get Stream (HTTP {}): {})'.format(response.status_code, response.text))
    for response_line in response.iter_lines():
        if response_line:
            json_response = json.loads(response_line)
            print(json.dumps(json_response,indent=4,sort_keys=True))
1 Like

What API endpoint (and URL) are you connecting to? That error looks like it might come from connecting to an older version of the API.

Hi Andy thanks for the reply. The endpoint URL is https://api.twitter.com/2/tweets/search/stream. I am more or less following the methodology presented here https://github.com/twitterdev/Twitter-API-v2-sample-code/blob/main/Filtered-Stream/filtered_stream.py and continue to get the same provisioning error. Is this perhaps an access issue?