API

The Sentdex API currently provides two major services:

  • Serves Financial sentiment signals.
  • Serves raw data from our stock sentiment analysis database.

While we also track many other topics, we do not have an official API set up for everything. If there's anything specific you want regarding information Sentdex tracks, contact Harrison@sentdex.com for custom solutions.

The Sentdex Finance API has data on mainly the US markets, with some Forex and commodity data. Sentdex tracks over 600 company tickers, mainly consisting of S&P 500 companies. Want to make sure the company you want is included?

This table contains all of the tickers we track, including non-stocks like commodities and bitcoin. Search either for the ticker or the name of the instrument.

Symbol Instrument Name
AGN Allergan PLC
NYX Euronext
NFLX Netflix, Inc.
EXC Exelon Corporation
TMK Torchmark Corporation
PCCC PC Connection Inc
CPB Campbell Soup Company
DNR Denbury Resources Inc.
AXP American Express Company
SRCL Stericycle, Inc.
XYL Xylem Inc.
WU The Western Union Company
YUM Yum! Brands, Inc.
FL Foot Locker, Inc.
EOG EOG Resources, Inc.
JWN Nordstrom Inc.
DLTR Dollar Tree, Inc.
WY Weyerhaeuser Co.
BA The Boeing Company
MCK McKesson Corporation
FLWS 1-800-Flowers.com Inc.
ADM Archer-Daniels-Midland Company
TAP Molson Coors Brewing Company
VNO Vornado Realty Trust
EURFX Euro Forex
NILE Blue Nile Inc.
UNM Unum Group
BWA BorgWarner Inc.
HSP Hospira Inc.
HST Host Hotels & Resorts, Inc.
SPG Simon Property Group Inc.
HSY The Hershey Company
DLPH Delphi Automotive PLC
AAPL Apple Inc.
PCLN The Priceline Group Inc.
CTSH Cognizant Technology Solutions Corporation
FIS Fidelity National Information Services, Inc.
GT The Goodyear Tire & Rubber Company
HAL Halliburton Company
FITB Fifth Third Bancorp
MJN Mead Johnson Nutrition Company
EQR Equity Residential
EQT EQT Corporation
VALE Vale S.A.
GPC Genuine Parts Company
MNKD MannKind Corp.
P Pandora Media, Inc.
GE General Electric Company
GD General Dynamics Corporation
VAR Varian Medical Systems, Inc.
X United States Steel Corp.
HAR Harman International Industries, Incorporated
HAS Hasbro Inc.
SYMC Symantec Corporation
CTXS Citrix Systems, Inc.
GPS The Gap, Inc.
MAS Masco Corporation
PKI PerkinElmer Inc.
MAT Mattel, Inc.
DTV DIRECTV
SNA Snap-on Incorporated
SYK Stryker Corporation
SNI Scripps Networks Interactive, Inc.
XRAY DENTSPLY International Inc.
MAC The Macerich Company
BRCM Broadcom Corp.
KIM Kimco Realty Corporation
JNJ Johnson and Johnson
SYY Sysco Corporation
HRS Harris Corporation
TSN Tyson Foods, Inc.
AEP American Electric Power Co., Inc.
AES The AES Corporation
BEN Franklin Resources, Inc.
AET Aetna Inc.
SKS Saks Inc
EL The Estee Lauder Companies Inc.
CMG Chipotle Mexican Grill, Inc.
MHFI McGraw Hill Financial, Inc.
CME CME Group Inc.
EMN Eastman Chemical Co.
PXP Plains Exploration and Production Company
CMA Comerica Incorporated
AMAT Applied Materials, Inc.
FTR Frontier Communications Corporation
AEE Ameren Corporation
CTAS Cintas Corporation
PCL Plum Creek Timber Co. Inc.
EMR Emerson Electric Co.
FDX FedEx Corporation
CMS CMS Energy Corp.
TSS Total System Services, Inc.
AEO American Eagle Outfitters, Inc.
CRM salesforce.com, inc.
GES Guess' Inc.
SBUX Starbucks Corporation
MAR Marriott International, Inc.
HOV Hovnanian Enterprises Inc.
VLO Valero Energy Corporation
MET MetLife, Inc.
TSO Tesoro Corporation
NWSA News Corporation
APOL Apollo Education Group, Inc.
LNKD LinkedIn Corporation
LSI LSI Corp
WWWW Web.com Group, Inc.
PG The Procter & Gamble Company
LOW Lowe's Companies Inc.
CNP CenterPoint Energy, Inc.
XL XL Group plc
PH Parker-Hannifin Corporation
FSLR First Solar, Inc.
K Kellogg Company
PM Philip Morris International, Inc.
EFX Equifax Inc.
GRMN Garmin Ltd.
IGT International Game Technology
HCBK Hudson City Bancorp, Inc.
OIL-C Oil Commodity
DDS Dillard's Inc.
DSW DSW Inc.
WGO Winnebago Industries, Inc.
QCOR Questcor Pharmaceuticals Inc
RAI Reynolds American Inc.
FFIV F5 Networks, Inc.
BLL Ball Corporation
S Sprint Corporation
NGAS-C Natural Gas Commodity
QCOM QUALCOMM Incorporated
XRX Xerox Corporation
BLK BlackRock, Inc.
FTI FMC Technologies, Inc.
HCN Health Care REIT, Inc.
NFX Newfield Exploration Co.
HPQ Hewlett-Packard Company
ANF Abercrombie & Fitch Co.
MA MasterCard Incorporated
CBG CBRE Group, Inc.
NOK Nokia Corporation
PRGO Perrigo Company Public Limited Company
SUG-C Sugar Commodity
PSA Public Storage
EXPR Express Inc.
NOC Northrop Grumman Corporation
MU Micron Technology, Inc.
CBS CBS Corporation
PSX Phillips 66
NDAQ The Nasdaq OMX Group, Inc.
SE Spectra Energy Corp.
MS Morgan Stanley
AON Aon plc
MCHP Microchip Technology Inc.
TJX The TJX Companies, Inc.
NOV National Oilwell Varco, Inc.
ALTR Altera Corp.
CMI Cummins Inc.
ETR Entergy Corporation
COP ConocoPhillips
IP International Paper Company
DVN Devon Energy Corporation
KMB Kimberly-Clark Corporation
BF-B Brown-Forman Corporation
DVA DaVita HealthCare Partners Inc.
ANN ANN INC.
KMI Kinder Morgan, Inc.
AMZN Amazon.com Inc.
GWW W.W. Grainger, Inc.
COST Costco Wholesale Corporation
FISV Fiserv, Inc.
FE FirstEnergy Corp.
COG Cabot Oil & Gas Corporation
COF Capital One Financial Corporation
CTL CenturyLink, Inc.
ADBE Adobe Systems Incorporated
PEG Public Service Enterprise Group Inc.
DOV Dover Corporation
COL Rockwell Collins Inc.
MSFT Microsoft Corporation
GLW Corning Inc.
SCHW The Charles Schwab Corporation
BSX Boston Scientific Corporation
CAM Cameron International Corporation
FCX Freeport-McMoRan Inc.
SILV-C Silver Commodity
SWN Southwestern Energy Co.
WFM Whole Foods Market, Inc.
CAMP CalAmp Corp.
UPS United Parcel Service, Inc.
BKS Barnes & Noble, Inc.
WHR Whirlpool Corp.
BBBY Bed Bath & Beyond Inc.
SCHL Scholastic Corporation
DDD 3D Systems Corporation
CELG Celgene Corporation
MDT Medtronic plc
CI Cigna Corp.
GBPFX GBP Forex
JDSU JDS Uniphase Corporation
F Ford Motor Co.
HCP HCP, Inc.
CB The Chubb Corporation
CA CA, Inc.
CF CF Industries Holdings, Inc.
DFS Discover Financial Services
KRFT Kraft Foods Group, Inc.
JEC Jacobs Engineering Group Inc.
JEF Jefferies Group
V Visa Inc.
HNZ H J Heinz
USDFX USD Forex
GIS General Mills, Inc.
MPC Marathon Petroleum Corporation
CHRW CH Robinson Worldwide Inc.
ALL The Allstate Corporation
NTAP NetApp, Inc.
TDC Teradata Corporation
LMT Lockheed Martin Corporation
BTCUSD Bitcoin
MMR Mcmoran Exploration
MMM 3M Company
MOS The Mosaic Company
PLD Prologis, Inc.
SO Southern Company
JNPR Juniper Networks, Inc.
HP Helmerich & Payne, Inc.
PLL Pall Corporation
CL Colgate-Palmolive Co.
MO Altria Group Inc.
MMC Marsh & McLennan Companies, Inc.
SD SandRidge Energy, Inc.
FMC FMC Corp.
WEC Wisconsin Energy Corp.
FHN First Horizon National Corporation
DPS Dr Pepper Snapple Group, Inc.
MSI Motorola Solutions, Inc.
CVX Chevron Corporation
AIZ Assurant Inc.
EIX Edison International
AIV Apartment Investment and Management Company
CVS CVS Health Corporation
BAX Baxter International Inc.
CAT Caterpillar Inc.
ZNGA Zynga, Inc.
COP-C Copper Commodity
CAH Cardinal Health, Inc.
GM General Motors Company
BAC Bank of America Corporation
CVH Coventry Health Care
CAB Cabela's Incorporated
AIG American International Group, Inc.
CAG ConAgra Foods, Inc.
CVC Cablevision Systems Corporation
URBN Urban Outfitters Inc.
BXP Boston Properties Inc.
EMC EMC Corporation
PPG PPG Industries Inc.
FRX Forest Laboratories
MNST Monster Beverage Corporation
LO Lorillard, Inc.
ISRG Intuitive Surgical, Inc.
LM Legg Mason Inc.
GAS AGL Resources Inc.
LH Laboratory Corp. of America Holdings
PPL PPL Corporation
DO Diamond Offshore Drilling, Inc.
DOW The Dow Chemical Company
HIG The Hartford Financial Services Group, Inc.
OKE ONEOK Inc.
DIS The Walt Disney Company
VPRT VistaPrint
WAT Waters Corporation
MON Monsanto Company
A Agilent Technologies Inc.
ABC AmerisourceBergen Corporation
JCP J. C. Penney Company, Inc.
GRPN Groupon, Inc.
BBRY BlackBerry Limited
LUK Leucadia National Corporation
NXY Nexen Energy ULC
YHOO Yahoo! Inc.
IR Ingersoll-Rand Plc
SIRI Sirius XM Holdings Inc.
STI SunTrust Banks, Inc.
SFLY Shutterfly, Inc.
STT State Street Corporation
ABT Abbott Laboratories
IRM Iron Mountain Inc.
MTB M&T Bank Corporation
VZ Verizon Communications Inc.
XOM Exxon Mobil Corporation
STX Seagate Technology Public Limited Company
JCI Johnson Controls Inc.
STZ Constellation Brands Inc.
CFN CareFusion Corporation
HOTT Hot Topic
PWR Quanta Services, Inc.
RSH RadioShack
CERN Cerner Corporation
BRK-B Berkshire Hathaway Inc.
RSG Republic Services, Inc.
CSCO Cisco Systems, Inc.
PNW Pinnacle West Capital Corporation
CLDX Celldex Therapeutics, Inc.
DAL Delta Air Lines, Inc.
MRO Marathon Oil Corporation
AVB Avalonbay Communities Inc.
TWTR Twitter, Inc.
PNC The PNC Financial Services Group, Inc.
ARO Aeropostale, Inc.
JPYFX JPY Forex
WDC Western Digital Corporation
GOLD-C Gold Commodity
DKS Dick's Sporting Goods Inc.
VFC V.F. Corporation
BK The Bank of New York Mellon Corporation
DRI Darden Restaurants, Inc.
CCL Carnival Corporation
CCI Crown Castle International Corp
CCE Coca-Cola Enterprises Inc.
TIE Titanium Metals Corp
TIF Tiffany & Co.
SHLD Sears Holdings Corporation
SAI Leidos Holdings
ACE ACE Limited
JOSB Jos A Bank
WTW Weight Watchers International, Inc.
ORLY O'Reilly Automotive Inc.
JOY Joy Global, Inc.
COV Covidien
FLIR FLIR Systems, Inc.
PRU Prudential Financial, Inc.
RF Regions Financial Corporation
POM Pepco Holdings, Inc.
MYL Mylan N.V.
LYB LyondellBasell Industries N.V.
RL Ralph Lauren Corporation
PGR Progressive Corp.
SIAL Sigma-Aldrich Corporation
D Dominion Resources, Inc.
CMCSA Comcast Corporation
PEP Pepsico, Inc.
DHR Danaher Corp.
CHK Chesapeake Energy Corporation
COFF-C Coffee Commodity
L Loews Corporation
ESRX Express Scripts Holding Company
WMT Wal-Mart Stores Inc.
HRL Hormel Foods Corporation
SNE Sony Corporation
T ATT, Inc.
MRK Merck & Co. Inc.
WMB Williams Companies, Inc.
ATI Allegheny Technologies Inc.
HRB H&R Block, Inc.
AMRN Amarin Corporation plc
TE TECO Energy, Inc.
IPG The Interpublic Group of Companies, Inc.
OI Owens-Illinois, Inc.
CINF Cincinnati Financial Corp.
FB Facebook, Inc.
TYC Tyco International Ltd.
RHI Robert Half International Inc.
APH Amphenol Corporation
NTRI Nutrisystem, Inc.
STJ St. Jude Medical Inc.
APC Anadarko Petroleum Corporation
APA Apache Corp.
APD Air Products & Chemicals Inc.
PCP Precision Castparts Corp.
KSU Kansas City Southern
GOOG Google Inc.
ARG Airgas, Inc.
MWV MeadWestvaco Corporation
KSS Kohl's Corp.
ESV Ensco plc
WFC Wells Fargo & Company
FLS Flowserve Corp.
FLR Fluor Corporation
ZMH Zimmer Holdings, Inc.
RHT Red Hat, Inc.
IFF International Flavors & Fragrances Inc.
NVDA NVIDIA Corporation
COH Coach, Inc.
ZION Zions Bancorporation
NTRS Northern Trust Corporation
HD The Home Depot, Inc.
KORS Michael Kors Holdings Limited
BMC BMC Software
LLY Eli Lilly and Company
ROK Rockwell Automation Inc.
ACOM Ancestry.com
DHI DR Horton Inc.
ECYT Endocyte, Inc.
NLY Annaly Capital Management, Inc.
ETN Eaton Corporation plc
SCG SCANA Corp.
RTN Raytheon Company
AMD Advanced Micro Devices, Inc.
HES Hess Corporation
ADSK Autodesk, Inc.
THC Tenet Healthcare Corp.
BMS Bemis Company, Inc.
PVTB PrivateBancorp, Inc.
BCR CR Bard Inc.
LLL L-3 Communications Holdings Inc.
ROP Roper Industries, Inc.
AMP Ameriprise Financial, Inc.
FDO Family Dollar Stores Inc.
BMY Bristol-Myers Squibb Company
AMT American Tower Corporation
LRCX Lam Research Corporation
AFL AFLAC Inc.
DISCA Discovery Communications, Inc.
PAYX Paychex, Inc.
CNX CONSOL Energy Inc.
OXY Occidental Petroleum Corporation
SHW The Sherwin-Williams Company
GCI Gannett Co., Inc.
ED Consolidated Edison, Inc.
EA Electronic Arts Inc.
FNMA Federal National Mortgage Association
KMX CarMax Inc.
ROST Ross Stores Inc.
AMGN Amgen Inc.
CSX CSX Corp.
VITC Vitacost.com
WPX WPX Energy, Inc.
EW Edwards Lifesciences Corp.
DLX Deluxe Corp.
PBI Pitney Bowes Inc.
BDX Becton, Dickinson and Company
TRV The Travelers Companies, Inc.
BTU Peabody Energy Corp.
CORN-C Corn Commodity
PCS T Mobile
AVY Avery Dennison Corporation
ABBV AbbVie Inc.
UNXL Uni-Pixel, Inc.
MKC McCormick & Company, Incorporated
AVP Avon Products Inc.
MGM MGM Resorts International
MDLZ Mondelez International, Inc.
SCTY SolarCity Corporation
CSC Computer Sciences Corporation
GMCR Keurig Green Mountain, Inc.
UA Under Armour, Inc.
HTZ Hertz Global Holdings, Inc.
IVZ Invesco Ltd.
ALXN Alexion Pharmaceuticals, Inc.
GS The Goldman Sachs Group, Inc.
NEM Newmont Mining Corporation
FOSL Fossil Group, Inc.
LUV Southwest Airlines Co.
MUR Murphy Oil Corporation
GNW Genworth Financial, Inc.
RRC Range Resources Corporation
ACI Arch Coal Inc.
NEE NextEra Energy, Inc.
ACN Accenture plc
NE Noble Corporation plc
ACT Actavis plc
WYN Wyndham Worldwide Corporation
JBL Jabil Circuit Inc.
UTX United Technologies Corporation
NI NiSource Inc.
TEL TE Connectivity Ltd.
ZLC Zale Corporation
QEP QEP Resources, Inc.
IBM International Business Machines Corporation
NBR Nabors Industries Ltd.
ECL Ecolab Inc.
SNDK SanDisk Corp.
NUS Nu Skin Enterprises Inc.
FAST Fastenal Company
TEG Integrys Energy Group, Inc.
SEE Sealed Air Corporation
WPO Cannabix Technologies
WPI West Peak Iron
NBL Noble Energy, Inc.
TER Teradyne Inc.
NUE Nucor Corporation
NU Nu Skin Enterprises
EXPE Expedia Inc.
EXPD Expeditors International of Washington Inc.
UNP Union Pacific Corporation
BHI Baker Hughes Incorporated
ADT The ADT Corporation
LLTC Linear Technology Corporation
CHFFX CHF Forex
DNB Dun & Bradstreet Corp.
GILD Gilead Sciences Inc.
CLF Cliffs Natural Resources Inc.
NWL Newell Rubbermaid Inc.
LULU Lululemon Athletica Inc.
GTN Gray Television, Inc.
TMO Thermo Fisher Scientific, Inc.
VTR Ventas, Inc.
CLX The Clorox Company
DTE DTE Energy Company
BBY Best Buy Co., Inc.
SJM The J. M. Smucker Company
UNH UnitedHealth Group Incorporated
PFE Pfizer Inc.
BBT BB&T Corporation
DGX Quest Diagnostics Inc.
ADI Analog Devices, Inc.
OMC Omnicom Group Inc.
SLM SLM Corporation
VIAB Viacom, Inc.
LEG Leggett & Platt, Incorporated
XEL Xcel Energy Inc.
WIN Windstream Holdings, Inc.
KO The Coca-Cola Company
VMC Vulcan Materials Company
LEN Lennar Corp.
EBAY eBay Inc.
KR The Kroger Co.
ARNA Arena Pharmaceuticals, Inc.
XLNX Xilinx Inc.
LNC Lincoln National Corporation
KEY KeyCorp.
ITW Illinois Tool Works Inc.
C Citigroup Inc.
NSC Norfolk Southern Corporation
KLAC KLA-Tencor Corporation
MOLX Molex Incorporated
TWC Time Warner Cable Inc.
SWK Stanley Black & Decker, Inc.
PNR Pentair plc
WYNN Wynn Resorts Ltd.
USB U.S. Bancorp
TSLA Tesla Motors, Inc.
AZO AutoZone, Inc.
DF Dean Foods Company
DG Dollar General Corporation
DD E. I. du Pont de Nemours and Company
DE Deere & Company
ETFC E*TRADE Financial Corporation
CIM Chimera Investment Corporation
SWY Safeway
WM Waste Management, Inc.
VRSN VeriSign, Inc.
RDC Rowan Companies plc
PDCO Patterson Companies, Inc.
TWX Time Warner Inc.
PHM PulteGroup, Inc.
PCAR PACCAR Inc.
TRIP TripAdvisor Inc.
TXN Texas Instruments Inc.
ADP Automatic Data Processing, Inc.
TGT Target Corp.
HBAN Huntington Bancshares Incorporated
PETM PetSmart
BIG Big Lots Inc.
BIIB Biogen Inc.
SRE Sempra Energy
PCG PG&E Corporation
WAG Walgreens
ORCL Oracle Corporation
TM Toyota Motor Corporation
ATVI Activision Blizzard, Inc.
PETS PetMed Express, Inc.
DUK Duke Energy Corporation
TXT Textron Inc.
PXD Pioneer Natural Resources Co.
AA Alcoa Inc.
HOG Harley-Davidson, Inc.
AKAM Akamai Technologies, Inc.
SPLS Staples, Inc.
SNTS Santarus
INTC Intel Corporation
HON Honeywell International Inc.
TIBX Tibco Software
M Macy's, Inc.
DELL Dell
ICE Intercontinental Exchange, Inc.
AN AutoNation Inc.
INTU Intuit Inc.
BEAM Beam Suntory
HOT Starwood Hotels & Resorts Worldwide Inc.
GME GameStop Corp.
TROW T. Rowe Price Group, Inc.
FMCC Federal Home Loan Mortgage Corporation
SLB Schlumberger Limited
MCO Moody's Corporation
JPM JPMorgan Chase & Co.
NKE Nike, Inc.
PFG Principal Financial Group Inc.
QDEL Quidel Corp.
MCD McDonald's Corp.
NRG NRG Energy, Inc.
PBCT People's United Financial Inc.
R Ryder System, Inc.
HUM Humana Inc.
PX Praxair Inc.
MCP Molycorp, Inc.

Is there something you want tracked that isn't here? Contact Harrison@sentdex.com to make a request.

Choose the tab that pertains to your interests:



Sentdex Sentiment Signals for Finance

Aside from offering the raw sentiment database access, Sentdex also offers signals that are generated from an algorithm applied to the raw sentiment data. These signals can be used directly for trading logic. For example, using a third-party back-testing service (Quantopian / Zipline), the following results were achieved trading purely on sentiment signals with a stop-loss:


The logic for this historically market-outperforming strategy is quite simple:

  • If the Sentdex Sentiment Signal is a 6, 10% of the portfolio's cash is allocated to the company, with a 0.5% stop loss.
  • If the Sentdex Sentiment Signal of a company currently being held hits -1 or lower, the company is sold.

This strategy trades the top 200 sentiment-volume companies. One could trade all companies, but Quantopian limits tickers to 255. The time frame of this back-test is the entire amount of time that Sentdex has been collecting sentiment data.

Do you have a Quantopian account, know how to use zipline, or Python? .

(This is zipline code, so these are methods of the TradingAlgorithm class):

def preview(df):
    log.info(df.head())
    return df

def initialize(context):
    context.investment_size = (context.portfolio.cash / 10.0)
    context.stop_loss_pct = 0.995
    set_symbol_lookup_date('2012-10-01')
    fetch_csv('http://sentdex.com/api/finance/sentiment-signals/sample/', pre_func = preview)
    context.stocks = symbols('AAPL', 'MCD', 'FB', 'GME', 'INTC', 'SBUX', 'T', 'MGM', 'SHLD', 'NKE', 'NFLX', 'PFE', 'GS', 'TGT', 'NOK', 'SNE', 'TXN', 'JNJ', 'KO', 'VZ', 'XOM', 'WMT', 'MCO', 'TWTR', 'URBN', 'MCP', 'MSFT', 'HD', 'KSS', 'AMZN', 'S', 'BA', 'F', 'JPM', 'QCOM', 'TSLA', 'YHOO', 'BBRY', 'GM', 'IBM', 'C', 'ZNGA', 'BAC', 'DIS', 'SCHW', 'UA', 'CSCO', 'ORCL', 'SYMC', 'WFC', 'TM', 'EBAY', 'SCHL', 'MS', 'NDAQ', 'TIF', 'AIG', 'DAL', 'JCP', 'MRK', 'CA', 'SIRI', 'AMD', 'CVX', 'FSLR', 'LMT', 'P', 'CBS', 'TWX', 'PEP', 'LNKD', 'CMG', 'NVDA', 'BBY', 'TWC', 'M', 'RHT', 'ACN', 'CRM', 'PETS', 'CELG', 'BLK', 'GD', 'DOW', 'YUM', 'GE', 'MA', 'DTV', 'DDD', 'CAT', 'FDX', 'GRPN', 'ACE', 'BK', 'GILD', 'V', 'DUK', 'FFIV', 'WFM', 'CVS', 'UNH', 'LUV', 'CBG', 'AFL', 'CHK', 'BRCM', 'HPQ', 'LULU', 'ATVI', 'RTN', 'EMC', 'NOC', 'MAR', 'X', 'BMY', 'LOW', 'COST', 'HON', 'SPLS', 'BKS', 'AA', 'AXP', 'AMGN', 'GPS', 'MDT', 'LLY', 'CME', 'MON', 'WWWW', 'MU', 'DG', 'TRIP', 'HAL', 'COH', 'WYNN', 'PCLN', 'HTZ', 'CLF', 'DD', 'ACI', 'FCX', 'AON', 'GMCR', 'CSX', 'ADBE', 'PRU', 'PG', 'MYL', 'STT', 'PPG', 'EXPE', 'KORS', 'JNPR', 'UTX', 'HOT', 'SNDK', 'CCL', 'DRI', 'BIIB', 'MHFI', 'BBT', 'APA', 'A', 'TDC', 'ANF', 'MTB', 'PPL', 'ABT', 'GNW', 'KMI', 'MET', 'FE', 'DVA', 'ETFC', 'GLW', 'NRG', 'INTU', 'KR', 'ARNA', 'VALE', 'MSI', 'EOG', 'AET', 'MAT', 'HST', 'COP', 'MO', 'IVZ', 'HUM', 'NUE', 'CI')

# Will be called on every trade event for the securities you specify. 
def handle_data(context, data):
    
    
    cash = context.portfolio.cash
    try:
        for s in data:
            
            if 'sentiment_signal' in data[s]:
                sentiment = data[s]['sentiment_signal']
                current_position = context.portfolio.positions[s].amount
                current_price = data[s].price
                
                if (sentiment > 5) and (current_position == 0):
                    if cash > context.investment_size:
                        order_value(s, context.investment_size, style=StopOrder(current_price * context.stop_loss_pct))
                        cash -= context.investment_size
                        
                        
                elif (sentiment <= -1) and (current_position > 0):
                    order_target(s,0)

    except Exception as e:
        print(str(e))
		

How the API works

We offer signals that are updated by the minute for any companies in the last 24 hours the have had any sentiment reports and we also offer daily averages, updated every 10 minutes, for any companies updated in the last day, 7 days, or 30 days.

Sentiment signals:

  • 6 - Strongest positive sentiment.
  • 5 - Extremely strong, positive, sentiment.
  • 4 - Very strong, positive, sentiment.
  • 3 - Strong, positive sentiment.
  • 2 - Substantially positive sentiment.
  • 1 - Barely positive sentiment.
  • 0 - Neutral sentiment
  • -1 - Sentiment trending into negatives.
  • -2 - Weak negative sentiment.
  • -3 - Strongly negative sentiment.

This scale is used to further break down positive sentiment. -3 sentiment is just as strongly negative as a positive 6 sentiment is strongly positive. Keep this in mind.

The above back-test is done using the daily means of company sentiment at market open, to avoid bias. The exact same data used in the back-test is also made available, for free, under this sample sentiment signals API link.



API URL and Parameters

http://sentdex.com/api/finance/sentiment-signals/

Parameters:

  • key (required) - This is your personal API key, required for access. If you just want a sample use this sample sentiment signals API link.
  • gran (optional) - Granularity of data. You can choose between '1min' for one minute and '1d' for one day. The default is 1d.
  • tf (optional) - Time Frame of data. You can choose '1d' '7d' or '30d' for one day, seven days, and 30 days respectively. If you choose 1min granularity, then you can only choose a 1d time frame.
Example sliced output: tf=1d gran=1min:
date,symbol,sentiment_signal
2015-06-17 18:04:00,VAR,1
2015-06-17 18:04:00,GOOG,-1
2015-06-17 18:04:00,BTCUSD,-1
2015-06-17 18:04:00,NOK,1
2015-06-17 18:04:00,KO,-3
2015-06-17 18:04:00,NWSA,1
2015-06-17 18:04:00,NDAQ,-1
2015-06-17 18:04:00,TGT,4
2015-06-17 18:04:00,TXN,-1
2015-06-17 18:04:00,T,-3

http://sentdex.com/api/finance/sentiment-signals/ticker/

Under this link, you can request sentiment signals for specific tickers / instruments. If you're looking for something specific, make sure it is included by using the lookup table, which you can find at the top of this page ("search our instrument selection").

The return here is just a number, which is the most recent sentiment signal for the company you are querying.

Example output: ticker=AAPL

3

http://sentdex.com/api/finance/sentiment-signals/sample/

This link is to a sample of signals. This contains the full history of Sentdex Sentiment Signals from inception Oct 2012 to June 2015.

They are 1-day means, per day, of any company with sentiment reported within the last 24 hours. The means are calculated 30 minutes prior to market open (13:00 GMT).

Access here is free. This is just a sample so people can do testing, and it is not automatically updated. I will update it from time to time.

Example sliced output:

date,symbol,sentiment_signal
2014-12-26 13:00:00,INTC,4
2014-12-26 13:00:00,TRIP,0
2014-12-26 13:00:00,JCP,0
2014-12-26 13:00:00,VIAB,1
2014-12-26 13:00:00,SD,0
2014-12-26 13:00:00,DPS,-3
2014-12-26 13:00:00,SHLD,-3
2014-12-26 13:00:00,GMCR,0
2014-12-26 13:00:00,ARO,0
2014-12-26 13:00:00,CBG,0

Get Sentdex Sentiment Signal Access

API access agreement.



Currently, the Sentdex API supports calls for single tickers at a time. Entire history is available, depending on account type.

We currently offer sentiment on ~600 companies through this API (See the above "search our instrument section" button to search for tickers that are available).

If the interest is there, I will bring in the Russell 3000, TSX 250, ASX 300 and FTSE 100 companies as well, which I also track.

Output comes in the form of time, ticker, raw sentiment value. Example output (unix times are in GMT):

[{"time": 1424733930, "ticker": "aapl", "sentiment": 1}]

URL: http://api.sentdex.com/ticker-sentiment

Example curl might look like: http://api.sentdex.com/ticker-sentiment/?ticker=abbv&after=1429809027&auth=xyzabcdefgh321fjsj

Parameters:

  • ticker - Required - The ticker symbol for the stock you are interested in.
  • after - Required - The unix time after which you want data.
  • auth - Required - Your Authorization token, which will be supplied to you upon purchase.
  • limit - Optional - A limit to the number of data points returned.

API access is paid-access, cost is depending on your needs.

To get started, contact Harrison@sentdex.com

Requests and suggestions are also welcomed.

Database download:

Want to play with the data, or do historical testing to see if it will fit your needs? Here's a dump containing data from Oct 2012 to June 15th 2015:

http://sentdex.com/downloads/stocks_sentdex.zip

The above is a csv version of a dump from the database. Columns are as follows:

id, time, type, value, open, close, high, low, MA100, MA250, MA500, M5000

Time is GMT, and the MA values are moving averages of the "value," which is the sentiment value.