GithubHelp home page GithubHelp logo

janlukasschroeder / realtime-newsapi Goto Github PK

View Code? Open in Web Editor NEW
201.0 8.0 34.0 20 KB

Financial News Aggregator - Real Time & Query API for Financial News

Home Page: https://newsfilter.io

JavaScript 100.00%
real-time realtime news newsapi news-feed news-aggregator newsfeed api reuters bloomberg

realtime-newsapi's Introduction

Real Time & Query API for Financial News

  • Covers more than 10,000 news sources (Reuters, Bloomberg, The Wall Street Journal, Seeking Alpha, SEC, and many more). See the full list of sources here.
  • Real-time financial news stream using websockets. The API returns a new article as soon as it is published on one of the supported news platforms.
  • Query API to search the newsfilter.io article database
  • JSON formatted
  • Articles mapped to company ticker
  • Supports Python, C++, JavaScript (Node.js, React, jQuery, Angular, Vue), Java and Excel plugins using websocket or socket.io clients

https://i.imgur.com/Rd7x9Mi.png

Real Time Streaming API

You can use the streaming API in your command line, or develop your own application using the API as imported package. Both options are explained below.

Before you start:

  • Install Node.js if you haven't already. On Mac in the command line type brew install node.

Command Line

Type in your command line:

  1. npm install realtime-newsapi -g to install the package
  2. realtime-newsapi to connect to the stream
  3. Done! You will see new articles printed in your command line as soon as they are published on one of the supported news platforms.

Node.js

Type in your command line:

  1. mkdir my-project && cd my-project to create a new folder for your project.
  2. npm init -y to set up Node.js boilerplate.
  3. npm install realtime-newsapi to install the package.
  4. touch index.js to create a new file. Copy/paste the example code below into the file index.js.
const api = require('realtime-newsapi')();

api.on('articles', (articles) => {
  console.log(articles);
});
  1. node index.js to start listening for new articles. New filings are printed in your console as soon as they are published on one of the supported news platforms.

Live Demo

https://codesandbox.io/s/k5q6nwqkrr

Query API

Use curl or Postman to send requests to the query API. Articles that match your filter criteria are returned in JSON format.

  • API endpoint: https://api.newsfilter.io/public/actions
  • Supported HTTP Method: POST
  • Supported content type: JSON

Example - FDA Approvals

Return all articles with "FDA Approval" in the title or description of the article.

Demo: https://reqbin.com/bf9gon0l

{
  "type": "filterArticles",
  "queryString": "title:\"FDA Approval\" OR description:\"FDA Approval\""
}

Example - AAPL

Return all articles with mentioning AAPL.

Demo: https://reqbin.com/b6qkjsyl

{
  "type": "filterArticles",
  "queryString": "title:AAPL OR description:AAPL OR symbols:AAPL"
}

Response Format

  • id (string) - unique ID of the article
  • title (string) - title of the article
  • description (string) - description of the article
  • symbols (array) - array of ticker symbols mentioned in the article, e.g. AAPL
  • url (string) - URL to original article
  • publishedAt (string) - ISO 8601 formatted date of publication time
  • source (object)
    • id (string) - unique ID of news source
    • name (string) - human readable name of news source
  • author (string) - name of the author

Example

[
    {
      source: {
        id: 'seekingAlpha',
        name: 'Seeking Alpha'
      },
      symbols: ['EWH'],
      title: 'Hang Seng soars despite massive rally',
      description: 'Hong Kong is gearing up for more protests this week after hundreds of thousands of anti-government demonstrators braved heavy rain to rally peacefully on Sunday, marking a change to what have often been violent clashes.The scenes showed that the movement is far from fizzling out, triggering fears about retail, tourism and business confidence, as well as worries over the city\'s stock and property markets.The Hang Seng index still rose 2.2% overnight following a healthy lead from Wall Street and key interest rate reforms from the People\'s Bank of China.ETFs: EWH, FHK, FLHK',
      url: 'https://seekingalpha.com/news/3492784-hang-seng-soars-despite-massive-rally',
      publishedAt: '2019-08-19T03:23:00-04:00',
      id: 'c7007ef5eae6cf50225cc4f19d368fe5'
    },
  {
    source: {
      id: 'businesswire',
      name: 'BusinessWire'
    },
    symbols: ['CELG'],
    title: 'U.S. FDA Approves INREBIC® (Fedratinib) as First New Treatment in Nearly a Decade for Patients With Myelofibrosis',
    description: 'SUMMIT, N.J.--(BUSINESS WIRE)--Celgene Corporation (NASDAQ: CELG) today announced the U.S. Food and Drug Administration (FDA) has approved INREBIC® (fedratinib) for the treatment of adult patients with intermediate-2 or high-risk primary or secondary (post-polycythemia vera or post-essential thrombocythemia) myelofibrosis.1',
    url: 'https://www.businesswire.com/news/home/20190816005292/en/U.S.-FDA-Approves-INREBIC%C2%AE-Fedratinib-New-Treatment',
    publishedAt: '2019-08-16T14:30:00+00:00',
    id: '129bd08d615d573fed8e12dbb917436e'
  }
];

Consulting

This service is already used around the world by startups, top news organizations, graduate school researchers, and, of course, hackers like you :) If you or your company are interested in more advanced features feel free to email & contact me for consulting.

realtime-newsapi's People

Contributors

janlukasschroeder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

realtime-newsapi's Issues

Trying to generate an API key

Hi, I haven't had a response over email - I can't seem to generate an API key if I want to sign up to the free Starter plan. When I try on https://newsfilter.io/api-plans I just get taken to a page showing my account info (just my email address). Would appreciate help as I'm excited to try this out!

running realtime-newsapi and the example page https://codesandbox.io/s/k5q6nwqkrr returns nothing

Hello, i came across https://newsfilter.io/ and later your realtime-newsapi git repo.
I played a bit with your Query APi, it is fantastic. However when trying to run the Real Time Streaming API (i'm not a node.js expert but it looks like it's set up correctly) or using the example url https://codesandbox.io/s/k5q6nwqkrr nothing gets returned. Has something changed on your end so that real time doesn't work anymore? If nothing's changed, i'll keep looking.
Thanks!

Stream. or api.

Having trouble connecting to the api through socket, when I use stream.newsfilter.io the connection times out & when I follow the way you connected here in the module I get

Error: server error
   at Socket.../../node_modules/engine.io-client/lib/socket.js.Socket.onPacket (socket.js:455)
   at XHR.<anonymous> (socket.js:278)
   at XHR.../../node_modules/component-emitter/index.js.Emitter.emit (index.js:145)
   at XHR.../../node_modules/engine.io-client/lib/transport.js.Transport.onPacket (transport.js:149)
   at callback (polling.js:144)
   at Object.../../node_modules/engine.io-client/node_modules/engine.io-parser/lib/browser.js.exports.decodePayload (browser.js:399)
   at XHR.../../node_modules/engine.io-client/lib/transports/polling.js.Polling.onData (polling.js:148)
   at Request.<anonymous> (polling-xhr.js:129)
   at Request.../../node_modules/component-emitter/index.js.Emitter.emit (index.js:145)
   at Request.../../node_modules/engine.io-client/lib/transports/polling-xhr.js.Request.onData (polling-xhr.js:303)
   at Request.../../node_modules/engine.io-client/lib/transports/polling-xhr.js.Request.onLoad (polling-xhr.js:370)
   at XMLHttpRequest.xhr.onreadystatechange (polling-xhr.js:256)

other than that the only response I can seem to get is

{"online":true,"type":"api"}

I've tried using "apiKey", "Authorization", & "token" params.

Update:
I got a server error 500 payment error?
can you not access the stream with the research license?

[Feature] Forex Economic Calendar

Hi there, this looks like a fantastic project.

I was looking to start my own project to pull in financial news indicators for Forex, but I thought I should ask here first to see if you have any plans for this.

Thanks

Need Python Sdk for Realtime-newsapi

Hello Sir,
I hope your are doing great.I need python sdk of realtime-newsapi for my thesis project.Kindly let me know from where I can download the sdk to start scrapping data.Thankyou

Best Regards
Taha Ahmad

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.