Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
71 views

Is there a way to delve into objects using Node-Fetch API [duplicate]

I've been tasked with a project that requires the use of API. I would love to learn if possible, how to delve into an object using node-fetch API. I am looking to fetch a list of objects on a page, I ...
Dan's user avatar
  • 1
0 votes
0 answers
860 views

API works in browser but not when pulled from Node

Here is my code: import fetch from "node-fetch"; class BlueNileAPI { constructor() { } fetchDiamonds() { return fetch(`https://www....
boioboi's user avatar
  • 67
0 votes
0 answers
87 views

I am getting a response code of 400 or 429

I am working on REST API. From my end, everything seems to be fine. I've tried multiple libraries (AXIOS, request, fetch) in order to make a PUT call. However, I keep on getting 429 or 400 as a ...
RAJENDRA H's user avatar
0 votes
0 answers
229 views

node-fetch not working but axios is working fine

I have an express server on localhost from which I am making an Api call function get(){ console.log('calling get') fetch('https://www.nseindia.com/api/marketStatus') .then(val=>{...
J.Rosnovski's user avatar
0 votes
1 answer
5k views

node-fetch "api key is not a legal HTTP header" error

I am attempting to do a GET request to an external API using node-fetch. When I run the code, I get the below error: UnhandledPromiseRejectionWarning: TypeError: Bearer [api key]​ is not a legal HTTP ...
Shawn Stensberg's user avatar
0 votes
1 answer
437 views

JSON error in NodeJS Node-Fetch Call Stripe

For Some Reason, I am getting this error when using stripe API in node-fetch. Error: TypeError: Cannot use 'in' operator to search for 'signal' in {"method":"post","headers&...
King Of Missionary's user avatar
0 votes
1 answer
891 views

How do I properly route data through my Node API?

I have the following files: My routes - where the orders_count route lives: routes/index.js const express = require('express'); const router = express.Router(); const transactionsController = require(...
DougM's user avatar
  • 920
-1 votes
1 answer
58 views

Problem regarding the node-fetch api. Specifically, when attempting to use fetch to retrieve JSON data

Code below retrieves the JSON data without any problems. app.get('/startgame', (req, res) => { res.send('Welcome To The Start Of The Game') fetch("https://deckofcardsapi.com/api/...
James Le-Goff's user avatar
2 votes
1 answer
4k views

node-fetch GET with a parameter

I want to get a url with "username" paramater in it. How can i do it? Example: get url: api/find-username paramater: username: "exampleusername" Is it possible with node-fetch ...
Hasan Kayra's user avatar
0 votes
2 answers
908 views

Why am I getting a '400: Bad Request' when i try to change my Discord avatar?

Before i get 100 people telling me that automating user accounts is against the Terms of Service, I know that and i am willing to take the risk, i just came here for help because i've been trying for ...
c8h_'s user avatar
  • 143
2 votes
1 answer
5k views

How can I send a cookie via node-fetch

I recently started to work with the roblox api, It's been going good so far but I can't login. I tried to set the cookie by doing apiCall.headers.set-cookie = cookie, But that doesn't seem to work. ...
TheGreenMilko's user avatar
0 votes
1 answer
45 views

node js Consecutive API calls not executing

I'm working for a project for a course where I need to chain multiple API calls together. Currently everything in the first API call function executes and shows in the terminal but everything after ...
Michael Wycklendt's user avatar
2 votes
1 answer
6k views

403 access denied error with Node.js fetch on external API

I've deployed my Node.js Koa API app on Heroku. I'm making a call to a USAJOB.gov API and it works on my localhost. However, on Heroku I get this error: You don't have permission to access "http://...
Uy Hoang's user avatar
  • 311
-1 votes
2 answers
7k views

Node-Fetch API | What is text() stand for? (Promise issue) [closed]

can anyone tell me exactly what text() do? I see people using it like that, and its working indeed: async getRandomNumber() { return await fetch(`${this.url}random`) .then((...
Darmon's user avatar
  • 303
0 votes
2 answers
1k views

incorrect behaviour of node-fetch while trying to get token from an api

I want to connect to an external api using some node-fetch code. My code first sends the login details & should receive a token from the api. Then this token is used for all the later ...
Kapil Gupta's user avatar
  • 7,671