Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
API-NG Reference Guide - 20th October2014.pdf
Скачиваний:
91
Добавлен:
11.02.2015
Размер:
2.41 Mб
Скачать

Place a Betfair SP bet

placeOrders

Retrieve a list of markets that are in-play now

listMarketCatalogue

Retrieve a list of markets that are due to be turned

listMarketCatalogue

in-play

 

Retrieve a list of Settled, Void, Cancelled or Lapsed

listClearedOrders

bets

 

Market Data Request Limits

Although you can request multiple markets from listMarketBook, listMarketCatalogue and listMarketProfitandLoss, there are limits on the amount of data requested in one request.

The following table explains the "weighting" of data for each MarketProjection or PriceProjection. If you exceed the maximum weighting of 200 points, the API will return a TOO_MUCH_DATA error.

sum(Weight) * number market ids must not exceed 200 points

listMarketCatalogue

 

MarketProjection

Weight

MARKET_DESCRIPTION

1

RUNNER_DESCRIPTION

0

EVENT

0

EVENT_TYPE

0

COMPETITION

0

RUNNER_METADATA

1

MARKET_START_TIME

0

listMarketBook

 

PriceProjection

Weight

Null (No PriceProjection set)

2

SP_AVAILABLE

3

SP_TRADED

7

EX_BEST_OFFERS

5

EX_ALL_OFFERS

17

EX_TRADED

17

listMarketProfitandLoss

 

PriceProjection

Weight

Not applicable

4

Understanding Market Navigation

Recreating Website Navigation?

Please note: if you want to recreate the exact navigation hierarchy used by the Betfair website, please use the Navigation Data for Applications service.

In the new API, navigating markets uses the concepts of faceted search. You've probably seen faceted search used on sites like eBay or Amazon where you pick a category, for example "Shoes" and then you see a list of shoes. Then, you can narrow your search by facets. For example, by colour or price. In a similar way, the new Sports API lets you find markets you're interested in and then get data back about a facet of those markets.

The way to think of the API Navigation operations is to imagine a single table that lists every market, along with various metadata about the market. The columns of the table are the Facets (and the Nav Operations in API return some of them in combination):

As you can see, the table has four markets along with some of the metadata associated with that market. Of course, the actual table would have tens of thousands of markets and more columns.

Along the top, you can see three of the navigation operations. Each of those operations takes a "MarketFilter". The MarketFilter filters the table of markets and selects the ones that match. The MarketFilter can contain things like "going in play" or "eventId 7", etc. So, if you called "listCompetitions" and passed in a filter that looked like:

Code:

{ "filter": {"turnsInPlay" : true }}

The selected markets would look like:

In the example, the 1001, 2355, and the 5621 market are the ones that match the filter. As you called "listCompetitions" with that filter, then the data returned is the columns containing competition information:

In this example, you'd get a list of competitions like so:

Code:

{"competitionId" : "23", "competitionName" : "World Cup 2013"}

Notice that the competition "Final 2013" was not returned. This is because the market was not selected by the MarketFilter. Also, notice that although the market 2355 was selected by the MarketFilter, it is not associated with a competition, so no competition id and name were returned for that market.

As a further example, suppose that you used the same MarketFilter as before while calling listEvents. In that case, the data returned is the columns containing eventId and eventName for the markets that match the filter (i.e., turnsInPlay = True):

In this example, you'd get a list of events like so:

Code:

[{"eventId" : "24", "eventName" : "Arsenal Vs. Reading"}, {"eventId" : "124", "eventName" : "Ascot 16th September"}, {"eventId" : "23", "eventName" : "Cheltenham 17th September"}]

Again, notice that the event "Celtics vs Nicks" was not returned because it was not selected by the MarketFilter.

One further example. Suppose you were only interested in Line markets and you want to find all of the Sports (EventTypes) that contain Line markets. You would create a MarketFilter like this:

Code:

{ "filter": {"MarketBettingType" : "LINE" }}

And call listEventTypes with that filter. The markets selected by that MarketFilter would be:

and the data returned would be:

Code:

{"eventTypeId" : "4", "EventTypeName" : "Basketball"}

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]