Created
May 11, 2023 06:49
-
-
Save sumitpatel93/d4bc484bbbd9c6bb4eca2c77ea99775d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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