create account

Splinterlands Data Exploring For Beginners by elebrum

View this thread on: hive.blogpeakd.comecency.com
· @elebrum · (edited)
$3.45
Splinterlands Data Exploring For Beginners
![titledataForBeginners.jpg](https://images.hive.blog/DQmf9SdFDK858dPc8Msue3XAouvhqzu6oqAPLkZpG5TFdu3/title-dataForBeginners.jpg)

This article is for those wanting to get a start, and this is just a start, about exploring your battle data in Splinterlands...hopefully for those less technically inclined, although this will still require some tech savvy.

## First Step: Obtaining Your Battle History in JSON
Splinterlands provides an API, Application Programming Interface, that helps software outside of itself to work with its data. To access the Splinterlands API in a basic way to obtain your battle data, use the following link in a browser, replacing <your_player> with your own player name:
https://api2.splinterlands.com/battle/history?player=<your_player>

What you receive back may be overwhelming, for it will look something like the following:
![json_from_apia.png](https://images.hive.blog/DQmNtXgNutzYUzAQ6msYPmM411vALQ5pLJXY5KHQvXb3TTz/json_from_api-a.png)
...which can be a lot to take in.

![dividersplinterlands.png](https://images.hive.blog/DQmfErBQjdwYM47hXYDg9W3hk9qedoDvvfzFncjGQJndKac/divider-splinterlands.png)

### Don't Panic!

![dont_panic.png](https://images.hive.blog/DQmWZbp8dytVhWZkWw5aZ7sD7R4LjtqZWTimzDCra9FNsbg/dont_panic.png)

The returned data is in a JSON form, which can be more easily read by code and spreadsheet apps like Microsoft Excel, or free applications like OpenOffice or LibreOffice. Once imported into a spreadsheet program, one (and only one) battle will appear as a row with various columns like the following:

![firstrowa.png](https://images.hive.blog/DQmbaep2FdVTrAC721SQY4TQjrwxyxeBFZK4wx3zAu54UjX/firstrow-a.png)

![firstrowb.png](https://images.hive.blog/DQmQunv7BKhfK6kSzPFyVRbiy738y8XcGS4NzLvpe3xwGbi/firstrow-b.png)

In Excel, this can be done by going to its "Data" tab, then "From File," and then selecting From JSON:
![excela.png](https://images.hive.blog/DQmc7gdsXBTd59mAdyQCGEQisrniW3jMePJpGVoh8fJdTq3/excel-a.png)

So, back to the Excel file, each row has in itself some very useful information like the two player names, created date, match type, mana cap, etc. However, if you needed details like what cards were used, that is embeded into field labeled "details" with more JSON within:

![firstrowb.png](https://images.hive.blog/DQmQunv7BKhfK6kSzPFyVRbiy738y8XcGS4NzLvpe3xwGbi/firstrow-b.png)

Take that data, and the convert it from JSON and we can see more details, starting with a first level:

![detaila.png](https://images.hive.blog/DQmaFMKbbznAWBAgeSxDBvm6uRfr8aCNqpZospH6zgu6VNB/detail-a.png)

...then when Team1's details are examined we see even more embedded data:
![detailteam_one.png](https://images.hive.blog/DQmbFJaEhuqgxTD5j9LXfbdGppAwbEa9jT8FhqAEAzq3UeV/detail-team_one.png)

...then when "Monsters" are examined, we see even more embedded data:

![detailmonsterslist.png](https://images.hive.blog/DQmT1VFWwsNzZzNauhHpdVff6p19CgSyummyrLUv456TLrE/detail-monsters-list.png)
...which are just the six slots of monsters. Clicking on the first monster reveals its details:
![detailmonsters.png](https://images.hive.blog/DQmSan5yZ85rdDKFybySu8ywUSH3aFRTrLK8VfbsLRV4Kpf/detail-monsters.png)
...which reveals a card id of "162" which is Living Lava.


![dividera.png](https://images.hive.blog/DQmbSybvrA6LaMN4spSN4aeNGXfVGUwzM8Mxb8Fv7nkmKy9/divider-a.png)


## How Can I Make This Easier?

One of the easiest tools to use, other than a Spreadsheet's internal JSON conversion tools, is to use some sort of JSON to CSV/Excel converter like the following:
[JSON To CSV Converter](https://www.convertcsv.com/json-to-csv.htm)

The following does require more technical skills, but the other option is to use a script, and hopefully one you do not have to rewrite. One that I like is "battlesGetData.js" from the "splinterlands-bot" on GitHub:
[splinterlands-bot on Github](https://github.com/alfficcadenti/splinterlands-bot)

Direct link to script:
[Direct link to script](https://github.com/alfficcadenti/splinterlands-bot/blob/master/battlesGetData.js)

...which cleans up the data and adds it to a history.json file. A user then would use the combine.js:

Direct link to script:
[Direct link to script](https://github.com/alfficcadenti/splinterlands-bot/blob/master/combine.js)
...that takes the history.json file, and then combines it with whatever is in newHistory.json, and writes it out as a new "newHistory.json" file. This newHistory.json file would be the one to explore.

Link to some documentation about the Splinterlands SPI Itself:
[Link to some documentation about the Splinterlands SPI Itself](https://github.com/kiokizz/Splinterlands-API)

![dividerhivaa.png](https://images.hive.blog/DQmVEM66jwgNa3eUCzdkzaXueAgQ31rQwiDcXfKi6yPesPh/divider-hiva-a.png)

All of the above can be difficult or easy depending on previous knowledge. I am assuming someone would know the basics of Excel and navigating through some of these windows. Hopefully it is not too sparse of documentation to follow! Please let me know of any needed clarifications or needs of expanding on any items above.

![dividerhiveb.png](https://images.hive.blog/DQmU41nEpE4KBko6RYAVhfZ5kwA1Jb41xwyMp1oAUrMNd3c/divider-hiveb.png)

This is just a starter about exploring data in Splinterlands! This can lead to better team formation, and learning from past battles.

Take care and happy exploring!




👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
authorelebrum
permlinksplinterlands-data-exploring-for-beginners
categoryhive-13323
json_metadata"{"tags":["hive-13323","splintertalk","bot","api","splinterlands","oneup","tools","scripts","excel","data","json"],"image":["https://images.hive.blog/DQmf9SdFDK858dPc8Msue3XAouvhqzu6oqAPLkZpG5TFdu3/title-dataForBeginners.jpg","https://images.hive.blog/DQmNtXgNutzYUzAQ6msYPmM411vALQ5pLJXY5KHQvXb3TTz/json_from_api-a.png","https://images.hive.blog/DQmfErBQjdwYM47hXYDg9W3hk9qedoDvvfzFncjGQJndKac/divider-splinterlands.png","https://images.hive.blog/DQmWZbp8dytVhWZkWw5aZ7sD7R4LjtqZWTimzDCra9FNsbg/dont_panic.png","https://images.hive.blog/DQmbaep2FdVTrAC721SQY4TQjrwxyxeBFZK4wx3zAu54UjX/firstrow-a.png","https://images.hive.blog/DQmQunv7BKhfK6kSzPFyVRbiy738y8XcGS4NzLvpe3xwGbi/firstrow-b.png","https://images.hive.blog/DQmc7gdsXBTd59mAdyQCGEQisrniW3jMePJpGVoh8fJdTq3/excel-a.png","https://images.hive.blog/DQmaFMKbbznAWBAgeSxDBvm6uRfr8aCNqpZospH6zgu6VNB/detail-a.png","https://images.hive.blog/DQmbFJaEhuqgxTD5j9LXfbdGppAwbEa9jT8FhqAEAzq3UeV/detail-team_one.png","https://images.hive.blog/DQmT1VFWwsNzZzNauhHpdVff6p19CgSyummyrLUv456TLrE/detail-monsters-list.png","https://images.hive.blog/DQmSan5yZ85rdDKFybySu8ywUSH3aFRTrLK8VfbsLRV4Kpf/detail-monsters.png","https://images.hive.blog/DQmbSybvrA6LaMN4spSN4aeNGXfVGUwzM8Mxb8Fv7nkmKy9/divider-a.png","https://images.hive.blog/DQmVEM66jwgNa3eUCzdkzaXueAgQ31rQwiDcXfKi6yPesPh/divider-hiva-a.png","https://images.hive.blog/DQmU41nEpE4KBko6RYAVhfZ5kwA1Jb41xwyMp1oAUrMNd3c/divider-hiveb.png"],"links":["https://api2.splinterlands.com/battle/history?player=&lt;your_player"],"description":"A brief about exploring the Splinterlands API from a basic user perspective.","format":"markdown","canonical_url":"https://www.splintertalk.io/@elebrum/splinterlands-data-exploring-for-beginners","app":"splintertalk/1.0.0"}"
created2022-03-26 16:37:51
last_update2022-03-27 01:07:39
depth0
children4
last_payout2022-04-02 16:37:51
cashout_time1969-12-31 23:59:59
total_payout_value1.739 HBD
curator_payout_value1.715 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length5,353
author_reputation52,914,593,359
root_title"Splinterlands Data Exploring For Beginners"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id111,710,274
net_rshares2,362,276,021,579
author_curate_reward""
vote details (43)
@candnpg ·
This is a great starter guide.  I was just starting to dip my toes into the API and this was a big help.  Thanks!
👍  
properties (23)
authorcandnpg
permlinkre-elebrum-r9d2m1
categoryhive-13323
json_metadata{"tags":["hive-13323"],"app":"peakd/2022.03.8"}
created2022-03-26 16:46:51
last_update2022-03-26 16:46:51
depth1
children1
last_payout2022-04-02 16:46:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length113
author_reputation67,406,869,241,233
root_title"Splinterlands Data Exploring For Beginners"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id111,710,467
net_rshares588,217,491
author_curate_reward""
vote details (1)
@elebrum · (edited)
Thank you! There is so much to go into! https://github.com/kiokizz/Splinterlands-API helps, but I think most would be interested in battle history. Although the same concepts, with different API calls, could be used to explore market history, leaderboards, upcoming tournaments, etc.
properties (22)
authorelebrum
permlinkre-candnpg-l183brnu
categoryhive-13323
json_metadata{"tags":["splintertalk"],"format":"markdown","canonical_url":"https://www.splintertalk.io/@elebrum/re-candnpg-l183brnu","app":"splintertalk/1.0.0"}
created2022-03-26 16:52:30
last_update2022-03-27 01:38:36
depth2
children0
last_payout2022-04-02 16:52:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length283
author_reputation52,914,593,359
root_title"Splinterlands Data Exploring For Beginners"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id111,710,641
net_rshares0
@globalwarming ·
Thanks for putting together. Helpful. Sharing this on Splinterlands Digest Twitter.
👍  
properties (23)
authorglobalwarming
permlinkr9fdvg
categoryhive-13323
json_metadata{"app":"hiveblog/0.1"}
created2022-03-27 22:45:15
last_update2022-03-27 22:45:15
depth1
children0
last_payout2022-04-03 22:45:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length83
author_reputation298,944,893,609
root_title"Splinterlands Data Exploring For Beginners"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id111,743,882
net_rshares601,997,211
author_curate_reward""
vote details (1)
@hivebuzz ·
Congratulations @elebrum! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s):

<table><tr><td><img src="https://images.hive.blog/60x70/http://hivebuzz.me/@elebrum/upvoted.png?202203261733"></td><td>You received more than 50 upvotes.<br>Your next target is to reach 100 upvotes.</td></tr>
</table>

<sub>_You can view your badges on [your board](https://hivebuzz.me/@elebrum) and compare yourself to others in the [Ranking](https://hivebuzz.me/ranking)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>



**Check out the last post from @hivebuzz:**
<table><tr><td><a href="/hive-122221/@hivebuzz/pum-202203-25"><img src="https://images.hive.blog/64x128/https://i.imgur.com/JIdWpzd.png"></a></td><td><a href="/hive-122221/@hivebuzz/pum-202203-25">Hive Power Up Month - Feedback from February day 25</a></td></tr><tr><td><a href="/hivebuzz/@hivebuzz/birthday-6"><img src="https://images.hive.blog/64x128/https://i.imgur.com/NUxGxEC.png"></a></td><td><a href="/hivebuzz/@hivebuzz/birthday-6">Happy 6th Birthday to the Hive Community</a></td></tr><tr><td><a href="/nftforpeace/@hivebuzz/nft-for-peace"><img src="https://images.hive.blog/64x128/https://i.imgur.com/tBCp4ps.png"></a></td><td><a href="/nftforpeace/@hivebuzz/nft-for-peace">Introducing NFT for Peace</a></td></tr></table>
properties (22)
authorhivebuzz
permlinknotify-elebrum-20220326t175137
categoryhive-13323
json_metadata{"image":["http://hivebuzz.me/notify.t6.png"]}
created2022-03-26 17:51:39
last_update2022-03-26 17:51:39
depth1
children0
last_payout2022-04-02 17:51:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,399
author_reputation369,449,186,442,303
root_title"Splinterlands Data Exploring For Beginners"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id111,711,908
net_rshares0