Skip to content

Instantly share code, notes, and snippets.

@sumitpatel93
Created May 11, 2023 06:49
Show Gist options
  • Save sumitpatel93/d4bc484bbbd9c6bb4eca2c77ea99775d to your computer and use it in GitHub Desktop.
Save sumitpatel93/d4bc484bbbd9c6bb4eca2c77ea99775d to your computer and use it in GitHub Desktop.
const axios = require('axios');
async function fetchDuneData(queryId, apiKey) {
const apiUrl = `https://api.dune.com/api/v1/query/${queryId}/results`;
const response = await axios.get(apiUrl,{ headers: { 'X-Dune-API-Key': apiKey } });
return response.data.result.rows;
}
module.exports = {
fetchDuneData
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment