Export betMGM Bet History to CSV via the Developer Console

There’s no good way to get a nice clean output of your bets via the betMGM site when you need itemized wins and losses per bet. I ended up filtering the “Settled” section of the My Bets sidebar to a range and using this JavaScript helped me generate a CSV of my bets. I figured this might be helpful to others so I am copying my console script here for others.

You may need to expand the bet details view before running the code to get the Bet ID and Parlay data populated, and bet types I didn’t have may not work properly. betMGM could also change their site layout which could likewise break this, and the TL;DR is this code essentially comes with no guarantees in its accuracy and is unsupported, but is posted here to hopefully help someone in the future looking to extract their bet history in a similar way do it more quickly.

rows = []
    var bet_id = jQuery(this).find('.theme-copy-clipboard').text().replace("Betslip ID: ","")
    var bet_type =jQuery(this).find('.mybets-betslip-multi-header_bet-type').text() || "Straight"
    var pick_name = jQuery(this).find('.mybets-betslip-info_pick-name').text() || jQuery(this).find('ms-my-bets-betbuilder-expanded-info').text() || jQuery(this).find('.mybets-betslip-multi-collapsed-view_options').text()
    var market_name = jQuery(this).find('.mybets-betslip-info_market-name').text() 
    var event_name = jQuery(this).find('.mybets-betslip-non-event-info_event-name').text() || jQuery(this).find('.mybets-betslip-betbuilder-collapsed-view_event_name').text() || jQuery(this).find('.mybets-betslip-betbuilder-expanded-view_event_name').text()
    var event_date = jQuery(this).find('.mybets-betslip-non-event-info_event-date').text() || jQuery(this).find('.mybets-betslip-betbuilder-expanded-view_event-date').text()
    var stake = jQuery(this).find('.mybets-betslip-summary_stake-value').text() 
    var payout = jQuery(this).find('.mybets-betslip-summary_possible-winnings-value').text()
    var is_free_bet =  jQuery(this).find('.my-bets-used-reward-token').text().indexOf("Bonus Bet") == 0
    d = {'bet_id': bet_id, 'bet_type': bet_type, 'pick_name': pick_name, 'market_name': market_name, 'event_name': event_name, 'event_date': event_date, 'stake': stake, 'payout': payout, 'is_free_bet': is_free_bet}
const dictionaryKeys = Object.keys(rows[0]);

const dictValuesAsCsv = rows.map(d => (
  dictionaryKeys.map(key => {
    if(d[key] && String(d[key]).indexOf(',') > -1) {
      return `"${d[key]}"`;
    return d[key];

const result = [dictionaryKeys.join(','), ...dictValuesAsCsv].join('\n');

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.