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

C# VS2012 Web Reference to API

$
0
0
Hi,

I am trying to connect to the betfair API using C# and VS2012 and this address:

https://api.betfair.com/global/v3/BFGlobalService.wsdl

I have successfully done this for another gambling exchange with no problem at all.

When I try and add the web reference VS tells me it is not found. When I put it in a browser, same thing (logged in or not logged in to betfair).

Can anyone tell me what I'm doing wrong?! Thanks

NB: I have recently downloaded some sample code from this forum. I can see the web references added, if I update them I receive the same message I see when trying to add one myself (HTTP: 401 gone)

placeOrder operation on API

$
0
0
Hello,

I noticed that the placeOrder operation requires a marketID. This tells me that the function needs to be called separately for each market that we want to bet on. This would slow down my bot. Is it possible to bet on multiple markets with one call to the operation?

On a separate note, is it possible to put multiple orders on the same market with one call to the function? If I can see a sample code for that, it would be very helpful.

Thank you.

Creating another APP KEY by accident...

$
0
0
What happens when someone tries to use the createDeveloperAppKeys for a second time?

Does this over-write the original key or is the user prevented from creating another key?

I don't want to try it in case it messes things up. I need to know for someone I am coding for.

Thanks.

You must write ContentLength bytes to the request stream before calling [Begin]GetRes

$
0
0
Hi
I'm getting an error in my code. It was working a while ago, but for some reason I can't seem to see where it might be wrong now.

Thanks

try
{
HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create("https://api.betfair.com/exchange/betting/json-rpc/v1");

if (MyProxy != null)
{
httpWebRequest.Proxy = MyProxy;
}

NameValueCollection CustomHeaders = new NameValueCollection();
CustomHeaders["X-Application"] = AppKey;
CustomHeaders["X-Authentication"] = SessionToken;
httpWebRequest.ContentType = "application/x-www-form-urlencoded";
httpWebRequest.Accept = "application/json";
httpWebRequest.Method = WebRequestMethods.Http.Post;
httpWebRequest.Headers.Add(HttpRequestHeader.Accep tCharset, "ISO-8859-1,utf-8");
httpWebRequest.Headers.Add(CustomHeaders);

Byte[] BA = Encoding.UTF8.GetBytes(Output);
httpWebRequest.ContentLength = BA.Length;

Stream SW = httpWebRequest.GetRequestStream();
SW.Write(BA, 0, BA.Length);

------- Failing here
HttpWebResponse httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();

Stream Reader = httpResponse.GetResponseStream();
StreamReader Sreader = new StreamReader(Reader);

String IN = Sreader.ReadToEnd();
return IN;

}
catch (Exception e)
{
return "ERROR : " + e.ToString();
}

Finding venue name using market ID

$
0
0
Evening all

Apologies for my ignorance, but I'm having a bit of newbie trouble - I'm filtering only on horse racing

I have the following code:

Code:

var marketFilter = new MarketFilter();

                var eventTypes = client.listEventTypes(marketFilter);
             
                ISet<string> eventypeIds = new HashSet<string>();
                foreach (EventTypeResult eventType in eventTypes)
                {
                    if (eventType.EventType.Name.Equals("Horse Racing"))
                    {
                        eventypeIds.Add(eventType.EventType.Id);
                    }
                }
                var time = new TimeRange();
                time.From = DateTime.Now;
                time.To = DateTime.Now.AddDays(1);

                marketFilter = new MarketFilter();
                marketFilter.EventTypeIds = eventypeIds;
                marketFilter.MarketStartTime = time;
                marketFilter.MarketCountries = new HashSet<string>() { "GB" };
                marketFilter.MarketTypeCodes = new HashSet<String>() { "WIN" };

                var marketSort = MarketSort.FIRST_TO_START;
                var maxResults = "1";

                //as an example we requested runner metadata
                ISet<MarketProjection> marketProjections = new HashSet<MarketProjection>();
                marketProjections.Add(MarketProjection.RUNNER_METADATA);


                Console.WriteLine("\nGetting the next available horse racing market");

                var marketCatalogues = client.listMarketCatalogue(marketFilter, marketProjections, marketSort, maxResults);
                String marketId = marketCatalogues[0].MarketId;
                var marketInfo = marketCatalogues.FirstOrDefault(x => x.MarketId == marketId);
                return test = marketInfo.Event.Venue + " - " + marketInfo.MarketName ;

However, Event.Venue is always null.

How would I go about getting the venue name using the market ID? If someone can explain to me the error of my ways, I'd be most grateful.

Mr Dean

Reliabilty

$
0
0
Wouldn't it be great if BF worked all the time, even when the Royals were asleep:

Nearly every day I great crappy drop outs about 12 - 4pm Aust time - I guess in BF land the team are asleep and the servers are having a rest, or getting backed up or who knows what - meanwhile, we are working and betting - or trying to - I tried to upload an image of my error report, but the upload service was out 'having a bevvy'.

I am paying you guys in com cant we get some reliability.

And B4 you ask, I bet into markets (totes/systems/pari ms etc) all around the world so I dont have time to report back the
exact error that you guys are having - just make it work - 'Please' :)

Grantay

Attached Images
File Type: png BF.png (10.2 KB)

Navigation Data

$
0
0
Has anyone tried extracting the Navigation Data as outlined here: Navigation Data for Applications?

I've managed to successfully make a call to the address and get the response back, but it takes a long time to return - something like 20 seconds just to get the raw Json back on a fast internet connection.

I can't think of a way to make the call more efficient - there doesn't appear to be a way to filter it.

Am I missing something? I can use the Market Navigation but the Navigation Data seemed convenient.

SelectionID Vs RunnerID

$
0
0
Hello,

Sorry if this is a stupid question but I have been reading through the API documentation but I wanted to know if either the SelectionID or RunnerID of a horse as returned in the runnerCatalog or associated metadata is unique to that horse across races/markets or just for a single race/market

How to identify missing parameter on placeOrder?

$
0
0
Hey guys,
I am trying to place an order via the API but receive a message that some of the required parameters is missing.
Here is what I send:
Quote:

{'params': {'instructions': [{'orderType': 'LIMIT', 'selectionId': 4030151.0, 'side': 'BACK', 'limitOrder': {'persistenceType': 'LAPSE', 'price': 100.5, 'size': 3.0}}], 'marketId': 1.120831103}, 'jsonrpc': '2.0', 'method': 'SportsAPING/v1.0/placeOrders', 'id': 1}
And here is the response:
Quote:

{u'jsonrpc': u'2.0', u'id': 1, u'error': {u'message': u'DSC-0018', u'code': -32602}}
As far the docs about placeOrder tell, I filled out the required fields.

What do I miss?

Thanks alot in advance!

volume traded single courses

$
0
0
Hello

The call functions that returns 0 on single volumes

how do I get the volume tradato individual market (example 1 x 2 )?

((("lastPriceTraded":1.94,"totalMatched":0.0))) why totalmatched 0 ????


call
{""priceData"":[""EX_TRADED""] ,""matchProjection"" : ""ROLLED_UP_BY_PRICE"",""exBestOffersOverrides"":{ ""bestPricesDepth"":1



response
{"jsonrpc":"2.0","result":[{"marketId":"1.120778111","isMarketDataDelayed":tr ue,"status":"OPEN","betDelay":0,"bspReconciled":fa lse,"complete":true,"inplay":false,"numberOfWinner s":1,"numberOfRunners":3,"numberOfActiveRunners":3 ,"lastMatchTime":"2015-09-27T11:27:08.572Z","totalMatched":118526.05,"totalA vailable":274741.67,"crossMatching":true,"runnersV oidable":false,"version":1106848155,"runners":[{"selectionId":63347,"handicap":0.0,"status":"ACTI VE","lastPriceTraded":1.94,"totalMatched":0.0},{"s electionId":676467,"handicap":0.0,"status":"ACTIVE ","lastPriceTraded":4.8,"totalMatched":0.0},{"sele ctionId":58805,"handicap":0.0,"status":"ACTIVE","l astPriceTraded":3.65,"totalMatched":0.0}]}]}

ApiNgJsonRpcOperations problem setting matchProject Get a Json error

$
0
0
Hi, I am using coded provided, but when I set market projection I get the follow error. any ideas how I can fix ths?

com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 99

I am calling this code
public List<MarketCatalogue> listMarketCatalogue(MarketFilter filter, Set<MarketProjection> marketProjection,
MarketSort sort, String maxResult, String appKey, String ssoId) throws APINGException {
Map<String, Object> params = new HashMap<String, Object>();
params.put(LOCALE, locale);
params.put(FILTER, filter);
params.put(SORT, sort);
params.put(MAX_RESULT, maxResult);

params.put(MARKET_PROJECTION, marketProjection);
String result = getInstance().makeRequest(ApiNgOperation.LISTMARKE TCATALOGUE.getOperationName(), params, appKey, ssoId);

here is the debug respose, it fails when parsing


Request: {"jsonrpc":"2.0","method":"SportsAPING/v1.0/listMarketCatalogue","id":"1","params":{"filter":{ "textQuery":"MATCH_ODDS","eventIds":["27538776"]},"maxResults":"1","sort":"FIRST_TO_START","locale ":"en_GB","marketProjection":["COMPETITION","MARKET_START_TIME"]}}

Response: {"jsonrpc":"2.0","result":[{"marketId":"1.120646450","marketName":"Match Odds","marketStartTime":"2015-09-28T19:00:00.000Z","totalMatched":111198.5,"competi tion":{"id":"31","name":"Barclays Premier League"}}],"id":"1"}

Server Time Error?

$
0
0
Is there anything wrong on the servers side with the time/date? There was no date changing after midnight. (Or I messed up something really bad with my program :D )

Help with c# excel addin

$
0
0
Hi all, I need a a few hours of time form a programmer to debug or support me.
I got an excel addin developed in c#. Now it has stopped working in windows 10. It uses netoffice to amange the com intefrace ad aloow calls into com.I stopped programming at vb6 and cant get this working.

I wrote an alternative in VB out of frustration but I am beaten trying to parse the json.
At his stage I would setle for either solution though my c# is obviously a bit smarter.
Can anyone help or is anyone interested in a few hours work?

Total matched bets for 'back' versus 'lay'

$
0
0
Hi all,

I am using the listMarketBook function of API to download the offered prices in the exchange for a game. This function shows the total matched amount for each selectionID; however it does not break down this matched amount as the total matched on the 'back' side of the market versus the 'lay' side. Is there a way to get this information please?

Navigation Tree Download in Excel VBA

$
0
0
Hi,

I am trying to find out which round the "Tennis Game" belongs in the Tournament.

I have tried "ListMarketCatalogue" but it doesn't contain this information.

Is there anything that says "MenuPath" or "Event Hierarchy"?


Here is the original query
I am trying to retrieve "Navigation Data for Applications" Download. I have found the documentation below.

https://api.developer.betfair.com/se...r+Applications

Can someone please help me write a "VBA" version of the "Input Statement" that I can send through using Excel?

I am familiar with the codes such as
{"jsonrpc": "2.0", "method": "SportsAPING/v1.0/listMarketBook", "params": {"marketIds":["1.113421376"],"orderProjection":"EXECUTABLE","EXECUTION_COMPLET E", "matchProjection":"ROLLED_UP_BY_PRICE"}, "id": 1}

However, this documentation is kind of confusing. What is "Accept", what is "Connection", why are we using X-Application: instead of "App Key"

Any help or guidance to get my started will be greatly appreciated.

Thanks,
Xpresson

Login Process Returns NULL

$
0
0
Hello I am trying to initiate a valid login so I can obtain a session token. The following code seems to just return a NULL json object.

Code:

            public string Login(string username, string password)
            {
                    const string postData = "username=user&password=pass";
                                HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://identitysso.betfair.com/api/login");
                                request.Method = "POST";
                                request.ContentType = "application/x-www-form-urlencoded";
                                request.Headers.Add("X-Application", "myKey");
                                request.Accept = "application/json";

                    using (Stream stream = request.GetRequestStream())
                    {
                            using (StreamWriter writer = new StreamWriter(stream, Encoding.Default))
                            {
                                    writer.Write(postData);
                            }
                    }

                    using (Stream reqSstream = ((HttpWebResponse) request.GetResponse()).GetResponseStream())
                    {
                                        using (StreamReader resReader = new StreamReader(reqSstream, Encoding.Default))
                            {
                                                var jsonResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<LoginResponse>(resReader.ReadToEnd());
                                    if (jsonResponse.loginStatus == "SUCCESS")
                                    {
                                            return jsonResponse.sessionToken;
                                    }
                                    else
                                    {
                                            Console.Write(jsonResponse.loginStatus);
                                    }
                            }
                    }

                    return null;
            }

betting bot

$
0
0
i am interesting to create my own betting bot (soccer and horses).the idea for soccer bot is to be connected to the web site that shows the moving odds for soccer or horses and based on my criteria of moving odds to place a bet on betfair .websites can be bet365 or soccer24 etc

can you help me pls

nikolas
http://forum.bdp.betfair.com/images/smilies/smile.gif

Confusion over API/Documentation

$
0
0
Hello

I am very new to the betfair api. So far i've had some success in getting the information I need. However I have reached a stumbling block!

I googled around for a way to find out a list of "market types". For example PLACE or WIN market. This forum directed me to this page:

https://api.developer.betfair.com/se...istMarketTypes

This implies that there is a function somewhere inside of the C# API which I can use to find this information out. However, The code located here:

https://github.com/betfair/API-NG-sa...sample-code/TO

Which I have used as my "API. Does not contain this function.

What am I missing?

SP Markets?

$
0
0
How would I get a list of all sports that have markets with Starting Prices?

String too long - Navigation Data for Applications

$
0
0
Hi,

I am using Navigation Data for Applications.

Is it possible to apply a filter to this? Currently, it is returning a string truncated down to 4,692,730 characters. (I am using VBA Excel)

I would like a method to help me get beyond the 4.6m characters or alternatively filter my query (By Match odds) or by Sport Type ID.

My codes are as follows

xhr.Send Data
SendMarketNavigationRequest = xhr.Responsetext
MsgBox Len(SendMarketNavigationRequest)

xhr.Responsetext is too long!

Many Thanks in advance.

Xpresson

https://api.developer.betfair.com/se...r+Applications
Viewing all 1639 articles
Browse latest View live