Upcoming events
Get details of upcoming events. If you can see an upcoming event on the events page, you can already get more details.
-
Get the data
Clicking the button opens a new tab with a lot of gibberish (aka JSON). Copy all of it and paste it in step 2.
-
Analyze data
Paste the data from step 1 into the following field and hit analyze.
-
Result
Upcoming events will appear after hitting the Analyze button
- Start Date:
- Description:
- Rewards:
Console snippet
Section titled âConsole snippetâI sometimes just prefer to use the browserâs console. You too? No problem. Donât like it? Just use the wizard above.
Open your browserâs console with F12 and paste the following code. Only works when youâre on the Sandbox website. Please make sure to understand what you do. Pasting and executing unknown code can be dangerous.
await fetch('https://api.sandbox.game/social-events?bannerVisualization[]=events&upcoming=true&past=true&limit=10&offset=0&available=true').then(t=>t.json()).then(t=>{const e=t=>(r=t=>t?'text'===t.type?t.text:'hardBreak'===t.type?'\n':'paragraph'===t.type?(t.content||[]).map(r).join('')+'\n\n':'doc'===t.type?(t.content||[]).map(r).join(''):'':'')(JSON.parse(t)).replaceAll(/\n{3,}/g,'\n\n').trim();return Object.fromEntries(t.upcoming.rows.map(t=>[t.title,{startDate:t.startDate?new Date(t.startDate).toISOString().split('T')[0]:'?',description:e(t.description),rewards:t.rewards.map(t=>[t.amount||null,t.type,t.description?e(t.description):null].filter(Boolean).join(' '))}]))});
await fetch('https://api.sandbox.game/social-events?bannerVisualization[]=events&upcoming=true&past=true&limit=10&offset=0&available=true') .then(response => response.json()) .then(data => { // Sorry for the minified renderer ;-) const render = j => (r = n => !n ? '' : n.type === 'text' ? n.text : n.type === 'hardBreak' ? '\n' : n.type === 'paragraph' ? (n.content || []).map(r).join('') + '\n\n' : n.type === 'doc' ? (n.content || []).map(r).join('') : '')(JSON.parse(j)).replaceAll(/\n{3,}/g, '\n\n').trim() return Object.fromEntries( data.upcoming.rows.map(event => [ event.title, { startDate: event.startDate ? new Date(event.startDate).toISOString().split('T')[0] : '?', description: render(event.description), rewards: event.rewards .map(reward => [ reward.amount || null, reward.type, reward.description ? render(reward.description) : null, ].filter(Boolean).join(' ')), }, ]) ) })