Skip to main content

How do I get responses from multiple APIs on one page?

You can obtain multiple API responses on a single page using one of the following:

  • Promise.all()
  • await

An example for each method is given below.


The examples below are for Nuxt.js projects. You may need to make your own adjustments as needed.


The following expressions should match the URL of your API:
process.env.BASE_URL + '/rcms-api/14/top/1002'
process.env.BASE_URL + '/rcms-api/1/form/6'

Parallel execution with Promise.all()

The code sample below retrieves data concurrently as in (foo & bar & ...):

export default {
async asyncData({ $axios }) {
const [foo, bar] = await Promise.all([
$axios.$get(process.env.BASE_URL + '/rcms-api/14/top/1002'),
$axios.$get(process.env.BASE_URL + '/rcms-api/1/form/6')
return {foo,bar};

Serial execution with await

The code sample below retrieves data in a sequential order (foo -> bar -> ...):

export default {
data() {
return {
foo: null,
bar: null
methods: {
async doAsync() {
const foo = await this.$axios.$get(process.env.BASE_URL + '/rcms-api/14/top/1002');
const bar = await this.$axios.$get(process.env.BASE_URL + '/rcms-api/1/form/6'); = foo; = bar;
mounted() {

For more information on the above expressions, see:


If you have any other questions, please contact us or check out Our Slack Community.