Betfair Developers


Other
Other programming languages

Post Reply
mak90 mak90 is offline
Junior Member
 
Default Looking for Powershell/JSON-RPC help

Hi,

I am a relative newbie to BF/Powershell and looking for advice of people who have experienced how to do this before. I have connected to BF Login successfully and also to the JSON-RPC link (Invoke Web-Request).

My question is, I have made a successful connection and had a JSON response - but what can I do to make this meaniningful? i.e. Get a list of events etc.

I will paste a short amount of my response as it's quite large.

The JSONRPC response is related to the ListEvents call.

{"jsonrpc":"2.0","result":[
{"event":{"id":"28257451","name":"Leo 9th Sep","countryCode":"IE","timezone":"Europe/London","openDate":"2017-09-09T17:45:00.000Z"},"marketCount":1},

{"event":{"id":"28306983","name":"Dubb (AUS) 16th Jul","countryCode":"AU","timezon
e":"Australia/Sydney","venue":"Dubbo","openDate":"2017-07-16T02:09:00.000Z"},"marketCount":18},

{"event":{"id":"28306850","name":"Devn (AUS) 16th Jul","countryCode":"AU","timezone":"Australia/Sydney","venue":"Devonport","openDate":"2017-07-16T02:05:00.000Z"},
"marketCount":16},

{"event":{"id":"28304162"

Thanks in advance!
jabe jabe is offline
Senior Member
 
Default

I'm not familiar with Powershell. I'm using VB.NET and the first thing I did was to create a ton of classes that would later become objects which could receive converted JSON data.

Creating the classes took forever but told me where the data was that I was going to need further down the line.

There is a third party package for .NET from NewtonSoft that allows conversion between objects and JSON strings. No idea what Powershell users would use.

You can get lists of Events by specifying EventTypeIds (which, more or less, are sports or something), perhaps CountryCodes, and a range of start times.

A race meeting would be an event, but so would each race at the meeting, so watch that kind of thing.

With the EventIds returned, you can get MarketCatalogues. Events usually have several markets. You'll know the different kind of things that can be bet on for each sports event.

The MarketCatalogue represents the fixed data for a market, such as the start date/time, the event description, the runners (note that an outcome might be classed as a runner - eg: Home win, Away win, Draw).

The non-fixed data for a market is retrieved as part of the marketBook. This includes the betting information, such as latest odds, etc, etc.

Note that odds are called prices and the money related to a bet is called size.

There's a lot more besides, but this should help for now.
mak90 mak90 is offline
Junior Member
 
Default

Jabe,

Thanks for your time and recommendations in the reply - I will take these into account when I have a go later tonight.
Post Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump