Getting Started Call Flow simple examples

As a getting started howto, could you provide a call flow like on these 2 simple examples :

  1. Let’s say we want to select :
  • only bettable tennis events
  • retrieve the market type (ie money_line, one_x_two, correct_score, both_to_score, handicap etc)
  • competitors (ie players for tennis, teams for soccer etc)
  • the odd on back and lay
  • the available liquidity of each of these positions
  • information if the event won’t be live / will be live / is live (ie started)
  • exchange type (ie “back-lay” or something else)
  • odd type (ie decimal or something else)

For this example, what i meant as a call flow is about the order of subsequent calls you have to make to collect of this information. What could it be in this case?

We begin by get events then in the given result? what info is used to make the next call? If the next call is GET competitors then we need the event_ids which should be, for example “id”: “565413” delivered by calling Get Events, right?

i would represent this action by :

Call 1 : Get Events (“id” as one of the result) / Call 2 : Get ("event_ids which is the previous “id” as the parameter value) competitors.

This is an answer example to my question. What would be the complete same description for getting all the previous mentioned information all together?

This would answer, for example, this question : One of the information is about prices we can have with Get prices which is a call needing market_ids but where do we get this market_ids value? Would we describe this as :

Call 1 : Get events (“id”) / Call 2 : Get (“id”) markets (“id” this result call should represent the market id i think) / Call 3 : GET (market_ids which should be the “id” in call 2 result) prices.

Through these exmples, hoping you see the way i’m looking for to undersand the articulation logic to deal with Smarkets sport events data.

  1. Same call flow question about placing an order with an example for back or lay and how to retrieve the result of a place order ? I mean how to know if the submitted offer is not (yet) matched, or fully matched, or partially matched (but then how to retrieve all the different splitted stake / odd related to our submitted order?). I do see “orders_response” but i don’t see the split details about each odd/stake in there (ie you place a back with odd 1.35 and stake 15 and you get splitted result like : a match with odd 1.3 and stake 10 and a match with odd 1.25 and stake 5).

By the way is it possible splitted matched positions can not be in favor of the position. For example, the example above is not in favor of the betting person. This example would be : you place a back with odd 1.35 and stake 15 and you get splitted result like : a match with odd 1.35 and stake 10 and a match with odd 1.4 and stake 5.

As for question 1, what would be the call flow to place a position and retrieve these responses? (Call 1 : Post xxx (result x) / Call 2 : Get (parameter i) yyy ( result y ) / Call 3 : Get (parameter j) zzz (result z)

Could we have an option to directly retrieve values :

  • as decimal for odds
  • as euros for prices

Kind Regards

This is an example flow to what you are suggesting:

  1. Get the relevant events: use https://docs.smarkets.com/#/events/get_events with:
  • with_new_type=True
  • type_domain=tennis
  • type_scope=single_event
    Follow the pagination links to get all the events with multiple calls.
    “inplay_enabled” tells you which ones will be traded live, where “state” tells you if it’s live or not.
  1. Get the markets using https://docs.smarkets.com/#/markets/get_markets_by_event_ids (market_type is one of the properties)
  2. Competitors from: https://docs.smarkets.com/#/competitors/get_competitors
  3. Current prices on the exchange: https://docs.smarkets.com/#/prices/get_quotes
    I am not sure what you mean by "exchange type " or “odd type” as these are the same across the whole Smarkets ecosystem.

As for decimals for odds and euros for currency, it’s good feedback that we can consider in the future.

Hello Joao,

Thank you for reading my post and for your answer i’m glad i was understable enough so you can answer on part 1 of the post.

Part 2 was "Same call flow question about placing an order with an example for back or lay and how to retrieve the result of a place order ? I mean how to know if the submitted offer is not (yet) matched, or fully matched, or partially matched (but then how to retrieve all the different splitted stake / odd related to our submitted order?). I do see “orders_response” but i don’t see the split details about each odd/stake in there (ie you place a back with odd 1.35 and stake 15 and you get splitted result like : a match with odd 1.3 and stake 10 and a match with odd 1.25 and stake 5).
By the way is it possible splitted matched positions can not be in favor of the position. For example, the example above is not in favor of the betting person. This example would be : you place a back with odd 1.35 and stake 15 and you get splitted result like : a match with odd 1.35 and stake 10 and a match with odd 1.4 and stake 5.

As for question 1, what would be the call flow to place a position and retrieve these responses? (Call 1 : Post xxx (result x) / Call 2 : Get (parameter i) yyy ( result y ) / Call 3 : Get (parameter j) zzz (result z)"

Maybe that was not clear enough but if it was , would you have the same kind of answer you had with part 1?

Good point if decimals for odds and euros for currency can be implemented as it’s useful and avoid error prone.