Competitor_id on contracts is wrong or missing

Take event 25642182 which was “Crystal Palace vs. Liverpool” on 2019-11-23.

https://api.smarkets.com/v3/events/25642182/competitors/ gives two competitors, the ID for the “Liverpool” competitors is "663". This matches other events where Liverpool are competing and appears to be correct.

But, if I look at the main winner/WINNER_3_WAY market for that event, and get contracts (https://api.smarkets.com/v3/markets/9169609/contracts/) the competitor_id field has the value 6327 (note this is an int, not a string and doesn’t match the competitor id above at all).

For some other events the competitor_id on contracts for teams is null.

What makes this even worse is that teams aren’t consistently named in contracts either, e.g. sometimes it’s “Liverpool”, other times it’s “Liverpool FC” and many other variants.

Is there any consistent way to resolve competitors and track them between events? I’m only interested in football (and the EPL in particular) at the moment, but a general answer would be good.

Hi,

We only implemented competitors as their own resource recently - we are now using our own ids as opposed to data provider ids. If you look at a recent match you will see that ids are consistent across different routes:
https://api.smarkets.com/v3/events/42011458/competitors/ https://api.smarkets.com/v3/markets/12148262/contracts/

In regards to teams names, we use short names for contracts. So short_name in the competitors API call should correspond to the name in the contracts call.

Thanks for the response, that makes sense.

So in summary, competitor IDs should now be right.

Could you give a date after which competitor_id is reliable?