Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

300
Views
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 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!