Search code examples
pythontwittertweepyhttp-status-code-429

Why do I keep getting '429 Too Many Requests' for put requests to add members to a list on Twitter's API?


I am using the following Tweepy code to access the Twitter API endpoint https://api.twitter.com/1.1/lists/members/create.json

It seems that I cannot add more than about 80 members in a given day, but the rate limit is stated to be 75 / 15 minutes. I have my requests throttled to be 50 members every 1000 seconds (16.7 minutes).

Code:

members_to_add = groups['ct']
list_id = '1520581139982868483'
for member in members_to_add[1:2]:
    client.add_list_member(id=list_id, user_id=member)
    print(member)
    time.sleep(1000)

Is there another limit I am hitting that I don't know about?


Solution

  • Yes, there is unfortunately an undocumented rate limit for this endpoint.

    You can read more about it here (Twitter community forum).

    But the main points of the Twitter official answer is that they will not provide any information about that limit and that there is nothing that we can do about it.