Using a Third Party API with Wix fetch

The problem with your code is that you put the headers inside the call object. Wix’s .fetch() actually works by:

.fetch(url, options)

The options is an object which looks like this:

{
  method: 'get',
  headers: {
    'Content-Type': '<the target content type>',
    'Authorization': 'Bearer <your api key>'
  },
  body: 'key1=value1&key2=value2'
}