RapidAPI response telling me I'm not subscribed, although I am

75 Views Asked by At

I'm attempting to fetch data from Shazam Core API using the fetchBaseQuery function from Redux Toolkit.

import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react';

export const shazamCoreApi = createApi({
  reducerPath: 'shazamCoreApi',
  baseQuery: fetchBaseQuery({
    baseUrl: 'https://shazam-core.p.rapidapi.com/',
    prepareHeaders: (headers) => {
      headers.set('X-RapidAPI-Key', 'My very long key');
      headers.set('X-RapidAPI-Host', 'shazam-core.p.rapidapi.com');
      return headers;
    },
  }),
  endpoints: (builder) => ({
    getTopCharts: builder.query({ query: () => 'v1/charts/get-top-songs-in-world' }),
  }),
});

When debugging I noticed the API returns 403 status code with a response:

Response

{"message":"You are not subscribed to this API."}

Although I am subscribed for this specific API. I also saw in the debugger that the request does have the correct headers added to it and also the payload, what can I do?

I tried changing from hard coded API Key\Host to environment variable, but for no avail as well.

I also tried logging in to RapidAPI Client plugin in VSCode, and to resubscribe.

Request

0

There are 0 best solutions below