Questions tagged [newsapi]

Use for questions regarding the newsapi.org API. Do NOT use for any other news API.

Github page: github.com/News-API-gh
Docs: newsapi.org/docs

An API key is needed to use the API. The keys are free while one is in development.

30 questions
3
votes
1 answer

User Agent Missing error when making a get request to an API

I am trying to make a Project using news API and I keep getting userAgentMissing error. I've tried few things but I couldn't figure out what I am doing wrong. i've tried using https.request method as well but result was the same. app.get("/",…
Sunny
  • 81
  • 1
  • 9
1
vote
3 answers

The state updates, but doesn't show up on the page

here is the function i am using to update my news website project with infinite scrolling: import React,{ Component } from "react"; import NewsItem from './NewsItem'; import Spinner from "./Spinner"; import PropTypes from "prop-types"; import…
0
votes
1 answer

News details show mismatched information by hash after fetching by Ky library news API in React

Good day, While learning Java Script I faced the challenge with showing news details from World News API. After clicking the Link in order to move to NewsDetails page, the hash changes, therefore NewsDetails page shows mismatched text. Could you…
Mizuki
  • 1
0
votes
3 answers

How can I request the first 100 titles in NewsAPI instead of first one?

Here, the code returns the first article's title according to the search information import requests r =…
0
votes
0 answers

Uncaught (in promise) TypeError when trying to access a list of articles from NewsAPI

I am trying to create a news website which utilizes NewsAPI to fetch recent articles depending on the query. The end goal is that the user would be able to search up anything in the search bar, and it would list the recent articles that contain that…
b-rad90
  • 19
  • 4
0
votes
0 answers

newsapi.org does not display the content and url of the news.google.com image | NEWS API

When making a request to the API the return I get is this: { "source": { "id": "google-news", "name": "Google News" }, "author": "Euronews em Português", "title":…
0
votes
1 answer

newsAPI import error cannot import name 'NewsApiClient' from 'newsapi'

i wanted to make a program for news using the NewsApi.org Api, but i've got a problem i dont know how to solve. my code is: import requests from newsapi import NewsApiClient url = ('https://newsapi.org/v2/everything?' 'q=Apple&' …
0
votes
1 answer

NewsAPI not able to fetch news of a given city

So, I'm basically trying to make a website that brings information about cities when you input a city name. Right now all I'm able to, successfully, display is the weather report of a city. I'm trying to bring some news headlines as well. I tried…
0
votes
0 answers

How to handle multiple q parameters while fetching news headlines using NewsApicatcher API in Python?

am trying to retrieve a news headlines using the API NewsApicatcher i did what are mentioned in the documentation but when i try to use multiple q paramater i have an error. I've tried to use doubles quotes but still the error thank in advance. from…
frentych
  • 1
  • 1
0
votes
1 answer

Remove Duplicate Print Values (Python)

When making my code for NewsAPI, I am receiving almost 800 values. Within these 800 values, only 4 or so are non-duplicates depending on the keyword. Is there anyway to stop duplicates from generating? Here is my code : news_sources =…
0
votes
0 answers

How to save multiple outputs in a single dataframe for Sentiment Analysis?

I have been doing a GNews Sentiment Analysis using Python, where I take the keyword as input. Now if I run analysis for 20 different keywords, I want to save the dataframe I receive from each run on one single dataframe. It means the dataframes will…
0
votes
0 answers

When I try to run this code it gives me this error: Uncaught TypeError: Cannot read properties of undefined (reading 'map')

render() { return (

NewsMonkey - Top Headlines

{this.state.articles.map((element)=>{ return
0
votes
0 answers

How to do free hosting of a website which using NewsAPI.org Api (restricted for hosting)

I made my first website have great frontend and I'm using NewsAPI.org api for fetch news data. But it's restricted for hosting and i want to host my site to show my project to others. When i host the site and go for that particular domain page works…
0
votes
1 answer

How to handle json api arrays in flutter

I am getting data from newsapi for my flutter app. How to get the id of the source in this json data? { "status": "ok", "totalResults": 38,
 "articles": [ 
{ 
 "source": { "id": "independent", "name": "Independent" }, "author": "Rachel…
Aadhil
  • 3
  • 4
0
votes
1 answer

News API with user location

I'm trying to implement an external news feed. I'm currently using Newsapi.org and able to filter news by country and category. But I would like the news to be local to each user. Is there a way to get the users's location and some how use it in…
cemond
  • 1
1
2