Consistent 503 error from Twitter Ads API


#1

Hi - I am receiving 503 errors when trying to pull a single day of data. Please see below for additional details.

  • Using the Python Twython sdk for authentication and to make requests: https://twython.readthedocs.io/en/latest/#twython-api-documentation.
  • App Id: 8596508
  • Code for error replication:
    params = {‘end_time’: ‘2019-01-02T00:00:00-08:00’,
    ‘entity’: ‘CAMPAIGN’,
    ‘entity_ids’: [u’bpyhx’, u’bpyhy’, u’bpyhz’, u’bpyi0’, u’bpyi1’, u’bpyi2’, u’bpyi7’, u’bpyi9’, u’bpyia’, u’bpyib’, u’bpyic’, u’bpyie’, u’bpyif’, u’bpyig’, u’bpyih’, u’bpyii’, u’bpyij’, u’bpyik’, u’bpyin’, u’bpyio’],
    ‘granularity’: ‘HOUR’,
    ‘metric_groups’: u’ENGAGEMENT,BILLING,VIDEO,MEDIA,WEB_CONVERSION’,
    ‘placement’: ‘ALL_ON_TWITTER’,
    ‘start_time’: ‘2019-01-01T00:00:00-08:00’}
    from twython import Twython
    from twython import Twython
    twython = Twython(u’REMOVED’, u’REMOVED’, u’REMOVED’, u’REMOVED’)
    twython.get(‘https://ads-api.twitter.com/4/stats/accounts/1la15r’, params=params)

The above command returns: TwythonError: Twitter API returned a 503 (Service Unavailable), Service unavailable due to request timeout; please try the request again later.

Can you please help me resolve this issue? Let me know if you have any other questions.

Thanks!


#2

Hello,

503 errors are temporary and generally resolve themselves within a few minutes. Can you let us know the timestamp for when the issue occurred? Additionally, have you retried the request to see if it succeeds?

Thanks!


#3

Hi - I appreciate the response.

I agree, however I have received the 503 error multiple times when trying to request data.

Most recent timestamps of failures are:
2019-01-04 13:55
2019-01-03 09:30
2019-01-02 08:42

Let me know if you have any other questions.

Thanks!


#4

Hi - Following up on this post. Have you had a chance to look into this issue further?

Thanks!


#5

A quick update here, we’ve identified a couple issues with our analytics pipeline and are currently investigating for a root cause. We’ll update this thread once we know more. Additionally, please let us know if you experience this issue again please let us know along with the following details:

  • The full request/response bodies for the API call
  • The timestamps for when the issue occurred

Thanks!


#6

Hi - Please see the details below for the 503 error received.

params = {‘end_time’: ‘2018-12-03T00:00:00-08:00’,
‘entity’: ‘CAMPAIGN’,
‘entity_ids’: [u’bpyhx’, u’bpyhy’, u’bpyhz’, u’bpyi0’, u’bpyi1’, u’bpyi2’, u’bpyi7’, u’bpyi9’, u’bpyia’, u’bpyib’, u’bpyic’, u’bpyie’, u’bpyif’, u’bpyig’, u’bpyih’, u’bpyii’, u’bpyij’, u’bpyik’, u’bpyin’, u’bpyio’],
‘granularity’: ‘HOUR’,
‘metric_groups’: u’ENGAGEMENT,BILLING,VIDEO,MEDIA,WEB_CONVERSION’,
‘placement’: ‘ALL_ON_TWITTER’,
‘start_time’: ‘2018-12-02T00:00:00-08:00’}
from twython import Twython
from twython import Twython
twython = Twython(u’REMOVED’, u’REMOVED’, uREMOVED’, u’REMOVED’)
twython.get(‘https://ads-api.twitter.com/4/stats/accounts/1la15r’, params=params)

The above command’s response.content = ‘{“errors”:[{“code”:“SERVICE_UNAVAILABLE”,“message”:“Service unavailable due to request timeout; please try the request again later”}],“request”:{“params”:{}}}’
The timestamp of the request was: 2019-01-15T14:46:18.837664