• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

250
Vistas
errorCode 422 in my reactjs app using rapid api

This is my cryptoApi js file

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

const cryptoApiHeaders = {
    'X-RapidAPI-Key': 'xxxxxxxx',
    'X-RapidAPI-Host': 'xxxxx'
}
const baseUrl = 'https://coinranking1.p.rapidapi.com';

const createRequest =(url) =>({url, headers: cryptoApiHeaders});
export const cryptoApi = createApi({
reducerPath: 'cryptoApi',
baseQuery: fetchBaseQuery({ baseUrl }),
endpoints: (builder) => ({
    getCryptos: builder.query({
        query: (count) => createRequest(`/coins?limit=${count}`),
    }),
    getCryptoDetails: builder.query({
        query: (coinuuid) => createRequest(`/coin/${coinuuid}`),
    }),
})
});
 
export const {
    useGetCryptosQuery,useGetCryptoDetailsQuery
} = cryptoApi;

this is my API file where I'm fetching data from bing news search API (RapidAPI) and I'm able to fetch all coins data but when I tried to get the data of a single coin it throws me an error of 422

about 3 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda