Connect External APIs to TrendSpider | TrendSpider Blog Skip to Main Content

Connect External APIs to TrendSpider

|
Share on social media

TrendSpider just opened the door to deeper data customization. With the new Custom JS + HTTP update, you can now bring in third-party data from a growing list of supported vendors, including market news from Benzinga, options data from the CBOE, forex rates from 1Forge, crypto feeds from Binance, and even your own Google Sheets. Whatever your task, TrendSpider now integrates more tightly with the tools and data that drive your trading edge.

What is the Custom JS + HTTP Update?

Most trading platforms solely offer their own tools and data, limiting the possibilities for customization and automation. This update enables any trader to integrate customized data directly into TrendSpider from any external API source without infrastructure headaches.

Not Just an Update: A Foundation

This update goes beyond simply adding API support to indicators and scanners, it transforms TrendSpider into a fully flexible research environment with the freedom to experiment creatively and build.

Now you can spend your time refining trading logic and strategy development, confident that TrendSpider supports your workflow seamlessly in the background.

Your All-in-One Trading Engine

For many, the cost and complexity of accessing professional-grade data feeds are a major barrier. By combining TrendSpider’s extensive data ecosystem with your own third-party sources, you now have access to an institutional-grade toolkit without having to set up servers, manage databases, or deal with latency issues.

And this is only the beginning. TrendSpider is becoming more than a platform—it’s evolving into an open, collaborative environment where traders can not only create but share and showcase what they build. From scanners to strategies to entirely new tools, the possibilities are now limitless.

The Power of Full Customization

Easily Bring in Any Data

Whether it’s drug and food safety data from the FDA, weather data from OpenWeatherMap, live posts from X, or your personal data from Google Sheets, connecting third-party APIs and external datasets directly into TrendSpider has never been simpler.

Forget bouncing between multiple platforms. TrendSpider allows you to consolidate all essential data into a single, streamlined workspace, empowering you to focus solely on analyzing, strategizing, and trading.

Learn how to fetch external data and view supported data vendors

Code Directly in JavaScript

TrendSpider uses JavaScript, a widely-known and versatile language, not a proprietary scripting language that can take weeks to learn. With built-in support for popular libraries like papaparse for CSV data and fast-xml-parser for XML feeds, your indicators and strategies can leverage powerful data transformations and sophisticated calculations without additional complexity.

Turn Data Into Action

Charts & Data Visualization

Quickly turn your external data into custom indicators and overlays on TrendSpider that can be used to visualize your data. This part is easy, but the update extends far beyond visualization.

Backtesting That Actually Works at Scale

Run robust backtests with external data sources, bridging the gap between technical and fundamental strategy validation. You can also automate strategy adjustments based on real-time data feeds rather than relying on static historical datasets.

Fully Predictable & Consistent Trading Bots

Run a trading bot based on your backtest to ensure the results match live execution. With this update, you can backtest and build adaptive bots that adjust based on dynamic data rather than static rule sets.

Scanning Like Never Before

Run custom scans on 1,500 stocks in under 8 seconds—a level of speed that’s impossible using personal API access. No data vendor would allow that kind of request-per-second, but TrendSpider does it seamlessly.

Popular APIs to Kickstart Your Integration

Not sure where to start? Here is a list of popular APIs that TrendSpider currently supports:

  1. Market & Financial Data: CBOE, Polygon, Alpha Vantage, Yahoo Finance
  2. News Data: Benzinga, Bloomberg, Reuters
  3. Social Data: X, StockTwits
  4. Cryptocurrencies: Binance, Kraken
  5. Custom Datasets: Google Sheets & Google Drive

View the full list of supported APIs

Example Use Case

To demonstrate the power of the new Custom JS + HTTP update, we developed a fully functional options chain indicator using the Nasdaq’s third-party API. It dynamically displays the options chain for any ticker that has tradeable options.

options chain on TrendSpider chart

You can view the chain of the closest expiration and track options pricing in nearly real-time, all without leaving the TrendSpider platform. You can import the option chain indicator to see for yourself, or view the code at the bottom of this post to see how it works.

This is just one example of what’s possible with external data integrations, and we hope it sparks ideas for building your own tools using supported third-party APIs.

Now that you can pull in any data with ease, TrendSpider acts as a fully customizable research environment with limitless capabilities. From options data to social posts, you can build, backtest, scan, and visualize your strategies without any backend limits.

Option Chain Indicator Code

describe_indicator('Options Chain');
const UA = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36';
const assetType = current.assetType == 'etf' ? 'etf' : 'stocks';
const url = `https://api.nasdaq.com/api/quote/${current.symbol}/option-chain?assetclass=${assetType}&limit=1000`;
const optionsData = await request.http(url, 300, {'user-agent': UA, accept: 'application/json' });
assert(!optionsData.error, `Error fetching options data: ${optionsData.error}`);
const myData = optionsData.data;
assert(myData, `No data for ${current.ticker}`);
// Find the closest expiration date
const closestExpiry = myData.table.rows.find(row => row.expiryDate && row.strike);
assert(closestExpiry, "No valid expiration date found");
// Filter rows for the closest expiration date
const relevantRows = myData.table.rows.filter(row => row.expiryDate === closestExpiry.expiryDate && row.strike);
// Sort rows by strike price
const sortedRows = relevantRows.sort((a, b) => parseFloat(a.strike) - parseFloat(b.strike));
// Find the index of the current price
const currentPrice = close[close.length - 1];
const currentPriceIndex = sortedRows.findIndex(row => parseFloat(row.strike) >= currentPrice);
// Get 4 strikes above and 4 strikes below the current price
const startIndex = Math.max(0, currentPriceIndex - 4);
const endIndex = Math.min(sortedRows.length, currentPriceIndex + 4);
const limitedRows = sortedRows.slice(startIndex, endIndex + 1);
// Prepare the table data
const tableData = limitedRows.map(row => {
    const callOI = parseInt(row.c_Openinterest) || 0;
    const putOI = parseInt(row.p_Openinterest) || 0;
    const putCallRatio = callOI > 0 ? (putOI / callOI).toFixed(2) : '-';
    
    const callVolume = parseInt(row.c_Volume) || 0;
    const putVolume = parseInt(row.p_Volume) || 0;
    const volumePutCallRatio = callVolume > 0 ? (putVolume / callVolume).toFixed(2) : '-';
    
    return {
        c_Volume: row.c_Volume || '-',
        c_Openinterest: row.c_Openinterest || '-',
        c_Bid: row.c_Bid || '-',
        c_Ask: row.c_Ask || '-',
        c_Last: row.c_Last || '-',
        strike: row.strike,
        p_Last: row.p_Last || '-',
        p_Bid: row.p_Bid || '-',
        p_Ask: row.p_Ask || '-',
        p_Volume: row.p_Volume || '-',
        p_Openinterest: row.p_Openinterest || '-',
        putCallRatio: putCallRatio,
        volumePutCallRatio: volumePutCallRatio
    };
});
const textCell = (text, background = 'transparent') => ({
    text,
	color: 'var(--text-color)',
    paddingTop: 2,
    paddingBottom: 2,
    paddingLeft: 3,
    paddingRight: 3,
    background
});
paint_overlay('OptionsChain', { position: 'bottom_left', offset_y: 20, order: 'above_all' }, {
    background: 'var(--background-color)',
    rows: [
        {
            cells: [{
                text: `Options Chain for ${current.symbol}, Next expiry (${closestExpiry.expiryDate})`,
                color: 'var(--text-color)',
                colspan: 13,
                fontWeight: 'bold'
            }]
        },
        {
            cells: [
                textCell('Calls<br/>OI'),
                textCell('Calls<br/>Bid'),
                textCell('Calls<br/>Ask'),
                textCell('Calls<br/>Last'),
                textCell('Strike'),
                textCell('Puts<br/>Last'),
                textCell('Puts<br/>Bid'),
                textCell('Puts<br/>Ask'),
                textCell('Puts<br/>OI'),
                textCell('OI Put/Call<br/>Ratio'),
                textCell('Vol Put/Call<br/>Ratio')
            ]
        },
        ...tableData.map((row, index) => {
            const colorOverride = (index == currentPriceIndex - startIndex) ? '#00ffff22' : null;
            const callColor = colorOverride || (parseFloat(row.strike) <= currentPrice ? '#ff000022' : 'transparent');
            const putColor = colorOverride || (parseFloat(row.strike) > currentPrice ? '#00ff0022' : 'transparent');
            return {
                cells: [
                    textCell(row.c_Openinterest, callColor),
                    textCell(row.c_Bid, callColor),
                    textCell(row.c_Ask, callColor),
                    textCell(row.c_Last, callColor),
                    textCell(row.strike, colorOverride || '#0000ff22'),
                    textCell(row.p_Last, putColor),
                    textCell(row.p_Bid, putColor),
                    textCell(row.p_Ask, putColor),
                    textCell(row.p_Openinterest, putColor),
                    textCell(row.putCallRatio, colorOverride || '#ffff0022'),
                    textCell(row.volumePutCallRatio, colorOverride || '#ffff0022')
                ],
            };
        })
    ]
});Code language: JavaScript (javascript)

Stay up-to-date: Subscribe to posts like this!

Receive automated updates from the Software Updates category
This site is protected by reCAPTCHA and the Google Privacy Policy and Google Terms of Service apply. Don't worry, we hate spam, too! See TrendSpider Privacy Policy for details.

Latest posts

|

Jensen Huang Resigns as NVIDIA CEO: What it Means for NVDA Stock

After 33 years at the helm of the company he co-founded, Jensen Huang resigned as President, CEO, and board member of NVDA effective immediately on November 12, 2026. The departure was triggered by a deepening scandal involving alleged ties to a suspected Chinese intelligence asset, a second workplace affair, and a cascade of regulatory and […]
|

CoreWeave Stock Q3 Earnings: $3.7B Revenue Beat & 2026 Guide Raise

CoreWeave (CRWV) stock delivered a commanding Q3 2026 earnings beat on November 10, posting revenue of $3.7 billion against a consensus estimate of $3.5 billion and an adjusted EPS loss of $0.95 versus the expected $1.53 — a 38% EPS beat. The company simultaneously raised its full-year 2026 revenue guidance to $13.0–$13.3 billion, sparking an […]
|

Hims & Hers Stock Slides as Q3 EPS Miss & Weak Guide Shadow 49% Sales

Hims & Hers Health (HIMS) stock delivered another quarter of robust top-line expansion in Q3 2026, with revenue surging 48.7% year-over-year to $890.4M. However, an adjusted EPS miss and a materially below-consensus Q4 outlook sent shares sharply lower after the report, reflecting growing investor concern about profitability and the post-GLP-1 compounding transition. Key Takeaways: Beat […]
|

Rocket Lab Corporation Stock Drops as Q3 EPS Miss & Neutron Slip Outshine 73% Sales

Rocket Lab Corporation (RKLB) stock reported its strongest quarter on record in Q3 2026, with revenue surging 72.7% year-over-year to $267.8M, beating the $257.0M consensus by 4.2%. However, an adjusted EPS miss of -$0.08 versus the -$0.07 estimate, compounding concerns around the Neutron rocket’s delayed debut, sent shares tumbling more than 8% in after-hours trading […]