API down?

I am getting an error when I use the following code. It previously worked. Events is not in the JSON returned.

start_date=datetime.datetime.now()+datetime.timedelta(days=1)
events =client.get_available_events(states=['upcoming'],types=['horse_racing_race'],start_datetime_max=start_date,limit=20)

When I check what is returned I get the following


{"data":null,"error_type":"EVENTS_UNAVAILABLE"}

I also checked with football_match and received the same error.

Has something changed or I am now doing something wrong or is the API down?

Hi Sandy,
I have checked and it does not seem that any other members have reported an issue. Due to it being the weekend, would you be able to send this to us in an email to API@smarkets.com so we can get someone more familiar with the code to take a look at it for you?
Regards,
Adam

Hi Adam,

It seems to be working again. Not sure what happened - didn’t change code but seems to be working fine now.

Cheers,
Sandy

1 Like

Hi Adam,

I am regularly getting this error, though I often don’t. It seems relatively random when I get it and I don’t change any of the code. Do you know why this? Is this common with other users?

Cheers,
Sandy

Hi Sandy,

The team are still actively looking into this for you. In the meantime, they have suggested specifying a start_datetime_min and the request should return without that error more often than not.

As I said they are still looking into this and we will try to get back to you with a more complete resolution as soon as we can!

Thanks,
Gavin

Hi Gavin,

When I use start_datetime_min like so:

start_date=datetime.datetime.now()+datetime.timedelta(days=1)
events =client.get_available_events(states=[‘upcoming’],types=[‘horse_racing_race’],start_datetime_min=start_date,limit=20)

I get the following error:

TypeError: get_available_events() got an unexpected keyword argument ‘start_datetime_min’

Which seems strange as when I check the documentation [Smarkets Trading API] it is indeed a variable which can be specified.

Is there something I am doing wrong?

Cheers,
Sandy

Hi Sandy,

The team believe they have fixed this issue and have requested you update your code in order for the fix to go through.

Let me know how this goes and if you are still receiving the same error.

Thanks,
Gavin

Hi Gavin,

I am still regularly getting the same error.

I have developed some code and would like to deploy it to AWS and run this code daily but because this error is so persistent I am unable to use the API service in a meaningful way.

I have tried using start_datetime_min but this is not an argument the API accepts.

If you could please have a look at this issue that would be great.

Regards,
Sandy

Hi Sandy, I will pass this on to the team and try to get an answer for you as soon as possible.

Can I confirm you have updated your code in order for the fix to go through as per my reply on the 21st of December?

Thanks,
Gavin

Hi Gavin,

When I use ‘start_datetime_min’ this is not a keyword that the API accepts. So it doesn’t appear that your recommendation on the 21st of Dec works. Is there a developer at Smarkets that I can talk to directly to resolve this?

Thanks,
Sandy