Google News

FREEMIUM
Verified
By Newscatcher API | Updated 8 months ago | News, Media
Popularity

9.8 / 10

Latency

1,295ms

Service Level

98%

Back to All Discussions

How to Access [[PromiseValue]] Json in JavaScript

avatar
mgarmao830
a year ago

I am using javascript and this API. When I console log it with json it has two dropdowns. [[PromiseStatus]] and [[PromiseValue]]. I need to access Promise Value to access the articles. Any help would be much appreciated. Here is my code:

fetch(“https://google-news.p.rapidapi.com/v1/topic_headlines?country=US&lang=en&topic=NATION”, {
“method”: “GET”,
“headers”: {
“x-rapidapi-host”: “google-news.p.rapidapi.com”,
“x-rapidapi-key”: “MYKEY”
}
})
.then(response => {
let data = response.json();
console.log(data)
console.log(data.promise.promisevalue);
})
.catch(err => {
console.log(err);
});

Join in the discussion - add comment below:

Login / Signup to post new comments
Rating: 5 - Votes: 1