Course Level 2 restcountries API is down

The url https://restcountries.com/v3.1/all is completely down for the level 2 course. Getting either a 502 bad gateway error, or the connection just gets terminated. I was thinking of hardcoding the countries in a code node like this:

const countryData = {
  "India":     { region: "Asia",     subregion: "Southern Asia" },
  "Japan":     { region: "Asia",     subregion: "Eastern Asia" },
  "France":    { region: "Europe",   subregion: "Western Europe" },
  "Brazil":    { region: "Americas", subregion: "South America" },
  "Canada":    { region: "Americas", subregion: "North America" },
  "Sweden":    { region: "Europe",   subregion: "Northern Europe" },
  "Australia": { region: "Oceania",  subregion: "Australia and New Zealand" },
  "Germany":   { region: "Europe",   subregion: "Western Europe" },
  "Ukraine":   { region: "Europe",   subregion: "Eastern Europe" },
  "Cuba":      { region: "Americas", subregion: "Caribbean" }
};

return Object.entries(countryData).map(([name, data]) => ({
  json: {
    name: { common: name },
    region: data.region,
    subregion: data.subregion
  }
}
)
);

Is this going to cause any issues with any exam questions later on? Is there a different API I can hit?

Hello @pauljhollis ! When you’re calling the url thru n8n, are you following this? {ā€œmessageā€:ā€œā€˜fields’ query not specified or you’re requesting more than 10 fieldsā€,ā€œstatusā€:400}

It works for me upon accessing it, are you self-hosted?

welcome to the n8n community @pauljhollis
I’d say your workaround is reasonable for the Level 2 course. I couldn’t find official docs that confirm how the exam handles that specific API, but in most n8n exercises what matters is the data structure, not the source URL itself. Since your Code node keeps the expected fields (name.common, region, subregion), it should be fine for lessons focused on filtering, merging, or expressions. If a later exercise specifically tests the HTTP Request node, you can swap back to a live API then. As another option, you could use any public countries dataset or a local JSON file with the same structure.

Thanks for the reply @achamm ! It does seem to be working today, but yesterday, I was consistently getting 502 Bad Gateway errors, or just regular connection timeouts. Sometimes it worked, but most it didn’t. I tried using curl -s -o /dev/null -w "%{http_code}" "https://restcountries.com/v3.1/all" a few times yesterday outside of trying in n8n, and it always returned 502. But, today seems to be okay! it must have just been having some issues!

Hi @tamy.santos , thanks for the reply! It does seem to be working today, but appreciate the information. If it keeps happening and I have a problem finishing the exercise, I’ll give this a shot!