Forums

General Betting

Welcome to Live View – Take the tour to learn more
Start Tour
There is currently 1 person viewing this thread.
Judge Roughneck
04 Jun 15 11:18
Joined:
Date Joined: 14 Aug 07
| Topic/replies: 105 | Blogger: Judge Roughneck's blog
As will become apparent, I am a complete newbie with regards to using API’s.

This is not related to Betfair’s API but one that returns weather information in JSON format.

So far I have managed to retrieve the information by typing a request into my browser which brings the info up in a webpage. What I want to do is import this information into excel for analysis but have no idea how to go about this!

I have searched for tutorials online but they all seem to assume some prior knowledge. Can anybody point me in the direction of a webpage that explains this for a COMPLETE BEGINNER?
Or is this something that is un-realistic without programming experience?

TIA.
Pause Switch to Standard View API help for newbie
Show More
Loading...
Report DStyle June 4, 2015 2:54 PM BST
There are plenty of JSON to CSV converters which you can find online which will convert your JSON data into a comma separated file you can use in excel. This might be suitable depending on what you're trying to retrieve.

The problem is that JSON is used to return "objects" which often contain further "objects" inside of them, so putting them out to a flat format like a CSV might not work.

Have you ever written any code, and do you have a basic understanding of Object Orientated Programming?
Report aye robot June 5, 2015 11:24 AM BST
To do anything useful you're probably (almost certainly) going to need to learn a little programming. The good news is that you'll only need a very basic knowledge and it's very easy to learn. Any language will do - but personally I'd recommend Python, which is very easy to learn and yet very powerful if you want more from it.

Do yourself a favor - buy a book, set 2 days aside and learn.
Report Judge Roughneck June 6, 2015 10:39 AM BST
Thanks for the replies – Sorry I am a bit late coming back to this.

I have found a script online that converts JSON into a flat format in Google sheets which is a good start but I would really like to find the same thing for Excel (I have been searching but so far have had no luck).

Unfortunately my programming skills are limited to a small amount of editing VBA macros (unless you count inputting ZX BASIC programs in the 80’s!).

I would love to learn a bit more but nowadays am not sure my brain’s capabilities would stretch to learning programming. Most of what I would like to do involves Excel in some way so I guess if I was going to do it then concentrating on VBA would be the way to go?
Report aye robot June 7, 2015 10:22 PM BST
As DStyle suggests - In all probability the data will be multi-dimensional, which means it won't simply paste into a spreadsheet because a spreadsheet is two dimensional (columns and rows).

Imagine that each cell of a spreadsheet can be another spreadsheet, each cell of that another and so on - you are imagining multi dimensional data.

Your data will be structured in nested dictionaries and/or lists (in Python terminology).

Dictionaries and lists are very simple concepts that mean almost exactly what you would expect them to. You can probably work it out just by looking at one of your sample returns in a text editor and carefully splitting it up into different lines and indentations (tabs).

You could use vba to unpack your data into a useful form, but personally I find Python more easily comprehensible and it's widely regarded as being one of the easiest languages to learn. There is no particular advantage to being "attached" to excel and if anything it may introduce an unnecessary layer of confusion. If all you've done so far is fiddle with macros then you won't have sufficient knowledge for it to be a head start. On the other hand - all programming languages use the same concepts (variables, logic, loops and so on) so if you learn any one that will feed back into your ability to use vba.

By the time you're a quarter of the way through any Python tutorial book you'll be able to take your existing text file, extract the data and make some excel compatible csv files from the relevant bits. Trust me - I make a living from automated gambling and the sum total of my programming "education" in  is the first half of "Python Programming for the Absolute Beginner".

Seriously; just do it, it's a piece of p1ss.
Report mouse trap June 10, 2015 10:05 AM BST
some free beginner Python courses on the web:
https://www.coursera.org/course/interactivepython1
https://www.coursera.org/course/pythonlearn
https://www.edx.org/course/cs-all-introduction-computer-science-harveymuddx-cs005x
https://www.edx.org/course/introduction-computer-science-mitx-6-00-1x-0
Report Judge Roughneck June 11, 2015 3:59 PM BST
Aye,

The script that I mentioned, flattens out multi-dimensional data and seems to do a good job of it.

The reason I want to find the same thing for excel rather than google sheets is that  I want to integrate the information with an already existing excel spreadsheet.

I will look into the book you mention.

Mouse trap thanks for listing those, I will take a look.
Post Your Reply
<CTRL+Enter> to submit
Please login to post a reply.

Wonder

Instance ID: 13539
www.betfair.com