Skip to main content

Download news data from CNBC! CNBC's API

*** IMPORTANT LEGAL DISCLAIMER ***


ycnbc is not affiliated, endorsed, or vetted by CNBC, It's an open source tool that uses Web Scraping and is intended for research and educational purposes.


ycnbc offers a threaded and Pythonic way to news and market data from CNBC.

Changelog »


Why ycnbc is compelling:

  • Simplicity: Easy-to-use API for quick data retrieval.
  • Directness: No retries, ensuring immediate feedback on success or failure.
  • Focus: Specifically designed for CNBC data, providing relevant and targeted information.
  • Lightweight: Minimal dependencies for a streamlined experience.

Quick Start


Requirements

  • Python >=3.8+
  • curl-cffi>=0.5.9
  • lxml>=4.9.3
  • cssselect>=1.2.0

Installation

$ pip install ycnbc --upgrade --no-cache-dir

Usage for Markets

import ycnbc

markets = ycnbc.Markets()

quote_summary = markets.quote_summary('AAPL')
pre_markets = markets.pre_markets()
us_markets = markets.us_markets()
europe_markets = markets.europe_markets()
asia_markets = markets.asia_markets()
currencies = markets.currencies()
cryptocurrencies = markets.cryptocurrencies()
futures_and_commodities = markets.futures_and_commodities()
bonds = markets.bonds()
funds_and_etfs = markets.funds_and_etfs()

Usage for news

import ycnbc

news = ycnbc.News()

# Get trending news
trending_news = news.trending()

# Get latest news
latest_news = news.latest()

# Get news by category
economy_news = news.economy()
jobs_news = news.jobs()
white_house_news = news.white_house()
hospitals_news = news.hospitals()
transportation_news = news.transportation()
media_news = news.media()
internet_news = news.internet()
congress_news = news.congress()
policy_news = news.policy()
finance_news = news.finance()
life_news = news.life()
defense_news = news.defense()
europe_politics_news = news.europe_politics()
china_politics_news = news.china_politics()
asia_politics_news = news.asia_politics()
world_politics_news = news.world_politics()
equity_opportunity_news = news.equity_opportunity()
politics_news = news.politics()
wealth_news = news.wealth()
world_economy_news = news.world_economy()
central_banks_news = news.central_banks()
real_estate_news = news.real_estate()
health_science_news = news.health_and_science()
small_business_news = news.small_business()
life_insurance_news = news.life_and_health_insurance()
business_news = news.business()
energy_news = news.energy()
industrials_news = news.industrials()
retail_news = news.retail()
cybersecurity_news = news.cybersecurity()
mobile_news = news.mobile()
technology_news = news.technology()
cnbc_disruptors_news = news.cnbc_disruptors()
tech_guide_news = news.tech_guide()
social_media_news = news.social_media()
climate_news = news.climate()

Note:

  • URL pages containing news content that have the PRO tag still cannot be retrieved using this library.

Legal Stuff

ycnbc is distributed under the Apache Software License. See the LICENSE.txt file in the release for details.


P.S.

Please drop me a note with any feedback you have.

Asep Saputra

Metadata

Release files for ycnbc 1.0.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ycnbc 1.0.12
File Size Uploaded
ycnbc-1.0.12.tar.gz 14.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ycnbc 1.0.12
File Interpreter ABI Platform
ycnbc-1.0.12-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 28.8 kB

Release files / ycnbc-1.0.12.tar.gz

Download URL ycnbc-1.0.12.tar.gz
Size 14.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7f042596fbbeffbd755ef4d2b0e1371a9160925f66e9fb6c349e93dc01092284
BLAKE2b-256 checksum
How to use checksums
8e4910e7112389ea1b10f312ca9fdfc329eda7938112f8e534b839cf55feb8ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / ycnbc-1.0.12-py2.py3-none-any.whl

Download URL ycnbc-1.0.12-py2.py3-none-any.whl
Size 14.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
aa93b50d700368cb52fd3282826ec6a464fbefc3ed5876f425df1f29ded1d908
BLAKE2b-256 checksum
How to use checksums
ae03144d34714e1732674eba1157dad2718690a0d4e056f4b61cb7b6d44e2d72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

1.0.12 This release

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page