# load multiple json with d3.json

**URL:** <https://talk.observablehq.com/t/load-multiple-json-with-d3-json/10038>\
**Category:** Help\
**Created:** [November 24, 2024, 6:05pm UTC](https://talk.observablehq.com/t/load-multiple-json-with-d3-json/10038 "2024-11-24T18:05:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harisonic](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/harisonic/32/8915_2.png) [@Harisonic](https://talk.observablehq.com/u/Harisonic)\
**Post date:** [November 24, 2024, 6:05pm UTC](https://talk.observablehq.com/t/load-multiple-json-with-d3-json/10038/1 "2024-11-24T18:05:41Z")

</div>

Is there any way to load multiple json files with d3 json and use them all in then callback?

---

<div class="post-metadata">

**Author:** ![imakashram](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/imakashram/32/8918_2.png) [@imakashram](https://talk.observablehq.com/u/imakashram)\
**Post date:** [November 27, 2024, 10:53am UTC](https://talk.observablehq.com/t/load-multiple-json-with-d3-json/10038/2 "2024-11-27T10:53:14Z")

</div>

```auto
const file1 = 'data1.json';
const file2 = 'data2.json';
const file3 = 'data3.json';

Promise.all([
    d3.json(file1),
    d3.json(file2),
    d3.json(file3)
]).then(([data1, data2, data3]) => {
    console.log('Data from file 1:', data1);
    console.log('Data from file 2:', data2);
    console.log('Data from file 3:', data3);
}).catch(error => {
    console.error('Error loading JSON files:', error);
});

```
