Datastore API GET Entry Node.js example

For those of you who may struggle to understand the Datastore API cURL examples, I translated them into Node.js to help you out.

This example is based on the cURL example posted here..

GET Entry

const fetch = require('node-fetch');

let API_KEY = "YOUR_API_KEY";

let response = await fetch('https://apis.roblox.com/datastores/v1/3310576216/standard-datastores/datastore/entries/entry?datastoreName=Coins&entryKey=269323', 
{
    method: 'GET',
    headers: {
        'x-api-key': `${API_KEY}`
    }
});

// To print the response:
console.log(response);

// To print the data from the store:
let data = await response.json();
console.log(data);

Hopefully this will be helpful to someone. If you would like more examples feel free to let me know!

2 Likes

Thanks! I bet this will be help for me in the future!

1 Like

Good example but i don’t reccomend using node-fetch as it has some security vulnerabilities (Fixed)