Quantcast
Channel: Developer Program Forum
Viewing all 1639 articles
Browse latest View live

Blank response

$
0
0
I'm sure I'm missing something super simple, but I've been bashing my head against this for a while and I've even gone away from it and come back to it and I just can't work it out.

I've been using the new NG API for quite a while now happily and have got most of what I want worked out. I've done everything on the aus endpoint to date now I'm trying to do exactly the same thing on the UK endpoint and I'm getting a completely blank response. I'm not getting an error I'm not getting a response with a blank array in it, it just appears to be coming as a string of "".

For example if I post to

URI -> https://api-au.betfair.com/exchange/betting/json-rpc/v1

with the following json:
{"jsonrpc":"2.0","method":"SportsAPING/v1.0/listEventTypes","params":{"filter":{},"locale":"en "},"id":1}

I get a response of
Raw response:
{"jsonrpc":"2.0","result":[{"eventType":{"id":"1","name":"Soccer"},"marketCou nt":15},{"eventType":{"id":"2","name":"Tennis"},"m arketCount":2},{"eventType":{"id":"2378961","name" :"Politics"},"marketCount":4},{"eventType":
.......

However if the only thing I change in the code is the end point and I now do a post to

URI -> https://api.betfair.com/exchange/betting/json-rpc/v1

with the following json:
{"jsonrpc":"2.0","method":"SportsAPING/v1.0/listEventTypes","params":{"filter":{},"locale":"en "},"id":1}

I get my blank response. I've tried a few different methods, and it's the same. It works all fine on the Aus exchange as soon as I change that endpoint I get nothing. I'm assuming it's not anything to do with app keys or login tokens given that would at least give a response. I've checked the endpoint several times, I've tried copying and pasting it but to no avail.

Does anyone have any suggestions of where I could look next.

Same JSON Request, Different Results

$
0
0
I am trying to list the events given some parameters:

Here is what I execute (using the API tool, and the response)

Code:

Request data:
[{"jsonrpc": "2.0", "method": "SportsAPING/v1.0/listEvents", "params": {"filter":{"eventTypeIds":["7"],"marketCountries":["GB"],"marketTypeCodes":["PLACE"]}}, "id": 1}]
Controller.js?_dc=1444582376801:686 Response truncated to 4,000 chars:
[{"jsonrpc":"2.0","result":[{"event":{"id":"27566984","name":"Wind 12th Oct","countryCode":"GB","timezone":"Europe/London","venue":"Windsor","openDate":"2015-10-12T13:00:00.000Z"},"marketCount":8},{"event":{"id":"27566968","name":"Salis 12th Oct","countryCode":"GB","timezone":"Europe/London","venue":"Salisbury","openDate":"2015-10-12T12:50:00.000Z"},"marketCount":8},{"event":{"id":"27567030","name":"Sedge 12th Oct","countryCode":"GB","timezone":"Europe/London","venue":"Sedgefield","openDate":"2015-10-12T13:10:00.000Z"},"marketCount":7}],"id":1}]


Now, if I do this in my application:

Code:

Calling: SportsAPING/v1.0/listEvents With args: {"filter":{"eventTypeIds":["7"],"marketCountries":["GB"],"marketTypeCodes":["PLACE"]}}

Got Response: {"jsonrpc":"2.0","result":[{},{},{}],"id":1}


I get nothing!! Yes I am logged in.

Why!??!

Finding out if a goal has been scored

$
0
0
I'm just getting into writing betfair bots , I've written one already and plan on writing a second one which requires me to know if a goal has been scored. So I'm looking for advice on what's the best way to get this information programatically using a proper reliable API. As far as I can see the betfair API-NG doesn't supply such a service.

Maybe a 'cheap' way of doing it would be to poll the >0.5 goals market and wait until it closes, has anyone tried this?

Appreciate any comments or feedback,

99ticks

Best way of finding out the amount of money I can bet with

$
0
0
Hi

On the website you can easily see the amount of money each horse has available for betting, if you want to back bet, the money is in the LAY column and vice-versa.

However I am "guessing" this doesn't count for the "ladder" where paying bookies like Coral etc are higher up than any bet orders you place and will always take them. E.G If I want to place a £5 BACK bet on a horse and I can see £5 under the LAY section if no-one else went for the bet at the same time I would get it. However if someone more "Important" than me went for it they would

What is the best way IN CODE (JSON) - C# for obtaining the amounts of money available to place a bet (LAY and BACK) so that I don't have to cancel the bet straight after placing it if it wasn't fully matched - as I trade I need a full matched bet early on one side to give the other side more time to get matched.

For example at the moment I can do this

Calling: SportsAPING/v1.0/listMarketBook With args: {"marketIds":["1.121224303"],"priceProjection":{"priceData":["EX_BEST_OFFERS"]},"orderProjection":null,"matchProjection":null,"l ocale":null,"currencyCode":null};

And get a full list of Runners with a number of amounts for LAY/BACK e.g

{"jsonrpc":"2.0","result":[{"marketId":"1.121224303","isMarketDataDelayed":fa lse,"status":"OPEN","betDelay":0,"bspReconciled":f alse,"complete":true,"inplay":false,"numberOfWinne rs":1,"numberOfRunners":10,"numberOfActiveRunners" :10,"lastMatchTime":"2015-10-14T12:59:15.478Z","totalMatched":28771.45,"totalAv ailable":142145.5,"crossMatching":true,"runnersVoi dable":false,"version":1134716766,"runners":[{"selectionId":6739276,"handicap":0.0,"status":"AC TIVE","adjustmentFactor":23.017,"lastPriceTraded": 4.3,"totalMatched":13323.13,"ex":{"availableToBack ":[{"price":4.3,"size":182.04},{"price":4.2,"size":17 6.93},{"price":4.1,"size":167.16}],"availableToLay":[{"price":4.4,"size":59.9},{"price":4.5,"size":228. 2},{"price":4.6,"size":42.54}],"tradedVolume":[]}},


Are these the top X prices/sizes per selection and are they in order e.g if I placed a bet I would get the first price/size not the last listed one?

What params do I need to supply to get the available amounts of money per horse (so if I had a SelectionID and MarketID - for a cut down version of just prices/sizes for that HORSE) - AND is there a way of knowing whether that if there is only £5 under a horse and I go for it I will get it rather than someone like Coral etc?

Also is it the same as the site e.g if I want to place a BACK bet I look at the LAY side and to LAY I look at the BACK side or is it more logical and the other way round.

E.G if I wanted to BACK bet on this horse and saw there was only £5.44 at a price of 46.00 for him I could place a £5 back bet safe in the knowledge it would get matched UNLESS CORAL or someone above me in the importance ladder took it instead,

{"availableToBack":[{"price":46.0,"size":5.44},{"price":44.0,"size":2. 46},{"price":38.0,"size":9.01}],"availableToLay":[{"price":50.0,"size":3.56},{"price":55.0,"size":10 .5},{"price":60.0,"size":14.71}],"tradedVolume":[]}}]}],"id":1};

I just want to make sure I can place the size of bets I want without having a MU (Matched/Unmatched) status until the full amount I requested is matched.

Thanks

Rob

Calculate Hedge Stake

$
0
0
Hello im trying to write a function which calculates the correct lay stake unfortunately I have it working however it doesn't correctly take into account the commission. Can anybody help?

Code:

        static public double CalculateHedgeLayStake(double backOdds, double layOdds, double backAmount = 1.0f, double backComission = 5.0f, double layComission = 5.0f)
        {
            double backComissionDecimal = backComission/100.0f;
            double layComissionDecimal = layComission/100.0f;

            double backWin = ((backAmount * (backOdds - 1.0f)) * (1.0f - backComissionDecimal));
            double layWin = backAmount * (1.0f - layComissionDecimal);

            double backLose = -backAmount;
            double layLose = backAmount * (layOdds-1.0f);

            double betWins = backWin - layLose;
            double betLoses = layWin - backLose;

            return backAmount + (betWins / layOdds);
        }

Very strange "place bet" delay.

$
0
0
Hello fellow botmakers and api diggers;).
I have very strange and unsatisfying "place bet" command delays. Despite the fact that my bot deployed very close to betfair, delay ranges from 50ms to 150-170ms, so it's nowhere near expected 15-20ms. But if i wittingly change some "place bet" parameters (for ex. set price to error value 2.01 or 777, whatever), and call this erroneous "place bet" command right after delayed "place bet" command (with right parameters), erroneous "place bet" command delay is 15-20 as it should be. So i have a few questions:

1. What delays do you, guys, have?
2. Is it happening because of "place bet" command is sent to another destination (for ex. somwhere faraway from Ireland) and calculated there?
3. And if some of users have right delays (15-20 or better), is it some sort of discrimination for other users?

Problems with login

$
0
0
For some reason I am constantly getting a problem with logging in

I get

"Navigation to the webpage was cancelled"

returned when I'm trying to bring up the login webpage

If I wait for 15-20 minutes it works again but when you're compiling, running and the compiling again it's a real pain.

Is anyone else having this problem???


It's the same code I have been using for months, so it has to be something with the enviroment I think.

Game results from API NG?

$
0
0
Hello all,

Does anyone know a betfair api service to download match results? Ideally by market ID so that my code can identify.Thank you.

Cannot create app key

$
0
0
I am trying to create an app key via the visualiser to use the new API, but I can't get it working. Below is my console log when calling createDeveloperAppKeys and getDeveloperAppKeys from the visualiser.

Calling createDeveloperAppKeys gives:

Code:

Request AppKey:
Request data:
[{"jsonrpc": "2.0", "method": "AccountAPING/v1.0/createDeveloperAppKeys", "params": {"appName":"test"}, "id": 1}]
Response truncated to 4,000 chars:
[{"jsonrpc":"2.0","error":{"code":-32099,"message":"AANGX-0008","data":{"AccountAPINGException":{"errorDetails":"","errorCode":"APP_KEY_CREATION_FAILED","requestUUID”:”<removed>”},”exceptionname":"AccountAPINGException"}},"id":1}]

Calling getDeveloperAppKeys gives:

Code:

Request AppKey:
Request data:
[{"jsonrpc": "2.0", "method": "AccountAPING/v1.0/getDeveloperAppKeys", "params": {}, "id": 1}]
Response truncated to 4,000 chars:
[{"jsonrpc":"2.0","result":[],"id":1}]

createDeveloperAppKeys obviously fails but there is no message to indicate why. I am using a valid session id (tried both the autofill in Chrome, and the session id returned from certLogin).

What could be causing this?

No rollup in listMarketBook

$
0
0
Is it possible to get unfiltered prices with no rollup from listMarketBook using priceProjection = EX_BEST_OFFERS? ie, the same data returned by EX_ALL_OFFERS, but only the portion containing the most competitive offers.

I have experimented with exBestOffersOverrides, and I notice that the API documentation for rollupModel = NONE says "No rollup will be applied. However the volumes will be filtered by currency specific minimum stake unless overridden specifically for the channel.". How do you "override it specfically for the channel"? Setting rollupLimit to zero does not seem to work.

Best wishes,
Alex.

Unique refId for account statement items

$
0
0
Hello,

I'm using getAccountStatement to track profit, commission, deposits etc., and the intention was to use refId to track unique items however I came across an example that breaks uniqueness.

Most cases in my account statement are horse races with more than one bet settled per market, in which case the settled P&L for each bet has a unique refId and the commission payment has another unique id. The counter example I have is a football market where there is a single bet settled in a particular market and I can see the settled bet P&L and the commission charged both have the same refId.

Why do two different account statement items have the same refId? Is there a different rule applied to football markets vs horse racing markets? Are markets with a single bet settled treated differently from markets with multiple bets settled?

EDIT: Going back through more historic data I've seen the same issue on horse racing markets with multiple bets settled, i.e. the commission item in the account statement has the same refId as one of the P&L items in the statement. So it's clearly not related to a particular sport or number of settled bets, but it doesn't always happen, i.e. there are some markets where the commission statement item has a distinct refId from any P&L statement item.

I searched the forum and documentation but didn't find an explanation. Thanks for your help.

Race Status

$
0
0
Is it up and running cos it's returning "DORMANT" with every request. Cheers

Exchange Maintenance - Thursday 29th October - 0630-0700 GMT

$
0
0
We’ll be performing essential Exchange and API maintenance between 6:30 and 7:00am tomorrow

During this time, bet placement will be unavailable. We’re sorry for any inconvenience this causes.

Betfair Developer Program

Cancelled Current Bets?

$
0
0
Apologies if this is the wrong place to ask - new to this forum.

I'm having trouble retrieving "Current" cancelled bets. For example:

- I create a bet via api (Lay in this case)
- I can see the bet using listCurrentOrders
- I cancel the bet through the betfair.com interface
- I can see the bet through the betfair.com interface by going to My Bets -> Exchange -> Current Bets -> select Cancelled
- I can't see the bet using listCurrentOrders with the .ALL projection, can't see the bet using listClearedOrders with any of the four statuses.

Once the market closes, I can see the bet using listClearedOrders/Cancelled.

What am I missing? How do I find the status of this bet via API?

Using API NG, by the way.

LimitOrder, LimitOnCloseOrder, MarketOnCloseOrder

$
0
0
Can someone please explain to me the difference between these 3?

I'm using a system that involves placing 3 bets simultaneously in 2 markets, I had been using LimitOrder, quoting the most recent price I gleaned from the API, however sometimes the price slips.

So if I quote a lower price on a back bet in a limitOrder will that try to match any price >= that price?

Am I right in saying a LimitOnCloseOrder waits until the market turns in-play and then checks that the opening price is beyond a certain threshold before placing the bet?

as for MarketOnCloseOrder, from the API docs it says Bets remain unmatched until the market is reconciled.

What does this mean? Appreciate if anyone could explain these to me, I'm fairly new to this.

Cannot get US horse racing with listMarketCatalogue

$
0
0
Hi, I was hoping to tweak my app to access Keeneland for the weekend. I employ a json string to call listMarketCatalogue, and have now added "USA" to the marketCountries parameters, but the response only returns GB and IE markets (the ones I have focused on hitherto). This is the first time I've attempted to dip a toe into US markets. Any idea what I'm doing wrong? Your advice would as always be greatly appreciated.
Mike

Reduction Factor for non-runner

$
0
0
Hi,

I have several questions regarding reduction factor for non-runners:

Question 1:
I have seen an example where the reduction factor is 25% and the Price of the original bet is 8 (pre-reduction) - I have seen two different answers regarding the post-reduction price: 6.25 and 6 - which one is correct? What is the formula to get the reduced price?
PriceReduced = 1 + (P-1)*(1-RF)?
or
PriceReduced = P*(1-RF)?

Question 2:
In case of successive reductions: first runner removed at time t1 and second runner removed at time t2 (t2>t1).
Let's consider the following sequence of events:
1/ runner removed at t1 - RF1=25%
2/ I matched at trade at price P = 10;
3/ then a second runner is removed - RF2 = 45%
what is the reduced price of my matched trade?
What is the formula at a function of P, RF1 and RF2?

Question 3:
What about rounding for reduced price? Is it rounded up/down/nearest two decimals, not rounded?

Thanks

Timeout calling getAccountFunds - still

$
0
0
Hi!
I still get exception a lot when calling getAccountFunds
I've got 87 times since 16:30 today
They all look like


2015-11-02 16:39:42.996 RPC.Get_JSON_Reply : posting:
Code:

{
        "method": "AccountAPING/v1.0/getAccountFunds",
        "jsonrpc": "2.0",
        "id": 15,
        "params": {
               
        }
}


2015-11-02 16:39:43.190 RPC.Get_JSON_Reply : Got reply:
Code:

{
        "id": 15,
        "jsonrpc": "2.0",
        "error": {
                "code": -32099,
                "data": {
                        "AccountAPINGException": {
                                "requestUUID": "prdaan002-10281041-0003568c77",
                                "errorCode": "UNEXPECTED_ERROR",
                                "errorDetails": ""
                        },
                        "exceptionname": "AccountAPINGException"
                },
                "message": "AANGX-0003"
        }
}

2015-11-02 16:39:43.190 RPC. : error.code -32099
2015-11-02 16:39:43.191 RPC. : APINGException.errorCode UNEXPECTED_ERROR
2015-11-02 16:39:43.191 RPC. : Error.Message AANGX-0003

times is in CET

Last successful call is at 2015-11-02 16:29:37.325
Then all failures
Then it works again at
2015-11-02 17:15:36.862

/Björn

Is there a limit to the bets I can place with placeOrder using PHP?s

$
0
0
Come across some annoying quirk where the API isn't letting me send more than 6 bets in a single request for some unknown reason. I'm using PHP and tweaked the sample code off the site. Can anyone think of a reason why the requests with over 6 bets are being rejected, unfortunately the API is only giving a response of null from the sample php code.

I'm just using the code below to submit the bets.

$jsonResponse = sportsApingRequest($appKey,$sessionToken, 'placeOrders/', $params);

$params of
Quote:

{"marketId":"1.121637352","instructions":[{"selectionId":10343384,"handicap":"0","side":"LAY ","orderType":"LIMIT","limitOrder":{"size":"50","p rice":"2","persistenceType":"MARKET_ON_CLOSE"}},{" selectionId":10485442,"handicap":"0","side":"LAY", "orderType":"LIMIT","limitOrder":{"size":"50","pri ce":"2","persistenceType":"MARKET_ON_CLOSE"}},{"se lectionId":6163562,"handicap":"0","side":"LAY","or derType":"LIMIT","limitOrder":{"size":"50","price" :"2","persistenceType":"MARKET_ON_CLOSE"}},{"selec tionId":10485441,"handicap":"0","side":"LAY","orde rType":"LIMIT","limitOrder":{"size":"50","price":" 2","persistenceType":"MARKET_ON_CLOSE"}},{"selecti onId":10351841,"handicap":"0","side":"LAY","orderT ype":"LIMIT","limitOrder":{"size":"50","price":"2" ,"persistenceType":"MARKET_ON_CLOSE"}},{"selection Id":10277121,"handicap":"0","side":"LAY","orderTyp e":"LIMIT","limitOrder":{"size":"50","price":"2"," persistenceType":"MARKET_ON_CLOSE"}}]}
Will happily go thru , whereas the following just gives a response as Call to api-ng failed: Response: null

Quote:

{"marketId":"1.121637352","instructions":[{"selectionId":10343384,"handicap":"0","side":"LAY ","orderType":"LIMIT","limitOrder":{"size":"50","p rice":"2","persistenceType":"MARKET_ON_CLOSE"}},{" selectionId":10485442,"handicap":"0","side":"LAY", "orderType":"LIMIT","limitOrder":{"size":"50","pri ce":"2","persistenceType":"MARKET_ON_CLOSE"}},{"se lectionId":6163562,"handicap":"0","side":"LAY","or derType":"LIMIT","limitOrder":{"size":"50","price" :"2","persistenceType":"MARKET_ON_CLOSE"}},{"selec tionId":10485441,"handicap":"0","side":"LAY","orde rType":"LIMIT","limitOrder":{"size":"50","price":" 2","persistenceType":"MARKET_ON_CLOSE"}},{"selecti onId":10351841,"handicap":"0","side":"LAY","orderT ype":"LIMIT","limitOrder":{"size":"50","price":"2" ,"persistenceType":"MARKET_ON_CLOSE"}},{"selection Id":10277121,"handicap":"0","side":"LAY","orderTyp e":"LIMIT","limitOrder":{"size":"50","price":"2"," persistenceType":"MARKET_ON_CLOSE"}},{"selectionId ":10485440,"handicap":"0","side":"LAY","orderType" :"LIMIT","limitOrder":{"size":"50","price":"2","pe rsistenceType":"MARKET_ON_CLOSE"}}]}
Got me stumped so any help or workarounds in php would be appreciated, thanks.

Cant get market runners

$
0
0
Hi, I am new with the library https://github.com/jmcarp/betfair.py .

I am trying to do some basic stuff but I can't find where are the runners in a market.

My code is:
from betfair import Betfair
client = Betfair('...', '...')
client.login('...', '...')
from betfair.models import MarketFilter

m = client.list_market_catalogue(MarketFilter(market_i ds=['1.121609334']))

print dict(m)

{'description': None, 'market_id': u'1.121609334', 'competition': None, 'market_start_time': None, 'total_matched': 6116.993151999999, 'market_name': u'Match Odds', 'event': None, 'runners': None, 'event_type': None}

Why the response from client.list_market_catalogue has only basic stuff?.

Edit:

I solved this, if anyone has the same problem you should use

m = client.list_market_catalogue(MarketFilter(market_i ds=['1.121609334']),market_projection=['RUNNER_DESCRIPTION'])

and explore https://developers.betfair.com/visua...ts-operations/
Viewing all 1639 articles
Browse latest View live