newsfilter.io - Stock Market News API

newsfilter.io - Stock Market News API

  • Home

›Stream API

Getting Started

  • Introduction
  • News Sources
  • Companies & Exchanges

Query API

  • Intro
  • API Endpoint
  • Authentication
  • Request & Response Formats
  • Example: Python
  • Example: cURL
  • Example: Node.js
  • Tutorials

Stream API

  • Intro
  • API Endpoint
  • Authentication
  • Message Format
  • Example: Python
  • Example: Node.js

Content Render API

  • Overview

Integrations

  • Discord

Python Example

Install socket.io for Python:

pip install "python-socketio[client]"

The simple example below creates a socket.io client, connects to our server and prints all articles as they are received.

import socketio

sio = socketio.Client()

@sio.on('connect')
def on_connect():
    print("Connected to Newsfilter Stream API")

@sio.on('articles')
def on_articles(articles):
    print(articles)

sio.connect('http://stream.newsfilter.io?apiKey=YOUR_API_KEY')
sio.wait()

Learn more about socket.io for Python here: https://python-socketio.readthedocs.io/en/latest/client.html

← Message FormatExample: Node.js →
newsfilter.io - Stock Market News API
Docs
Getting StartedQuery APIStream API
Contact
support@newsfilter.io
Social
Follow @newsfilterio
Follow Us on Stocktwits
Copyright © 2021 newsfilter.io