October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Advanced Charts

TradingView Snapshot API: Build a Reliable `snapshot_url` Upload Endpoint

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

TradingView’s Snapshot API is an upload contract, not a hosted image store. Set the chart widget’s snapshot_url to an internet-accessible HTTPS endpoint. TradingView sends a POST multipart/form-data request containing the generated PNG in a field named preparedImage. Your server validates and stores that file, serves it at a stable public URL, and returns the complete URL in its response. That URL powers Copy link, Open in new tab, and Tweet image.

Download and Copy image can work entirely in the browser. The server endpoint is required for actions that need a shareable URL.

What the TradingView snapshot API actually does

Advanced Charts creates the chart image. For server-backed actions, your application supplies storage and a public URL. TradingView’s library calls the URL configured in snapshot_url with a binary PNG upload. The endpoint must accept POST and return the URL of the saved image.

  • Request: multipart/form-data with a file field named preparedImage.
  • Payload: the generated chart snapshot as PNG.
  • Response: the full URL where the stored image can be fetched.
  • Storage: your responsibility; retention and deletion are not imposed by TradingView.

This is an HTTP integration contract. Express, another Node framework, Python, Go, or a managed object-storage service can implement it as long as the request and response behavior remain compatible.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Stock Market Trading Chart Patterns Poster Candlestick Patterns Cheat Sheet Stock Bullish Analysis Canvas Wall Art Investor Analysis Print Painting For Living Room Bedroom Office 12x16in Unframed
  • High-Quality Canvas Prints: Available in various sizes from 8x12in to 24x36in, this unframed or framed poster is printed on high-quality canvas, ensuring vibrant colors and long-lasting durability.
  • Comprehensive Stock Analysis: This trading chart patterns poster is a must-have tool for investors and traders, featuring detailed stock market patterns and bullish analysis to enhance your trading strategies.
  • Versatile Decor Options: Perfect for any space, whether it's your office, living room, bedroom, or even the kitchen. The aesthetic design makes it an excellent addition to your farmhouse or modern decor.
  • Educational and Practical: Designed as a cheat sheet, this poster includes essential chart patterns and trading places, making it a valuable reference guide for both beginners and experienced traders.
  • 【After Sale Service 】Once your poster Sets for Room Aesthetic artwork arrives,If you have any other questions, please you can contact us through Amazon anytime and anywhere ,we will answer you in the shortest time.Your satisfaction is our only pursuit.

Choose the right capture path

Server-backed snapshots

Use takeScreenshot() when the configured snapshot server should receive the image. When the upload completes, the chart library emits onScreenshotReady with the saved snapshot URL. The toolbar actions Copy link, Open in new tab, and Tweet image depend on this URL workflow.

Client-only capture

takeClientScreenshot() returns a Promise<HTMLCanvasElement>. Your application can convert the canvas to a PNG and download it, upload it to a different service, or process it locally. This avoids operating a snapshot endpoint, but it does not by itself create a durable public link.

Toolbar and trading drawings

Hide the snapshot toolbar by disabling the header_screenshot featureset. To include orders, positions, and executions, enable snapshot_trading_drawings. The predefined menu contains Download image, Copy image, Copy link, Open in new tab, and Tweet image; custom menu options are not supported.

Configure snapshot_url in the chart widget

Set the widget option to your fully qualified HTTPS endpoint. It must be reachable by the browser using the deployment’s public hostname; a localhost URL works only while the browser can access that same machine.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
new TradingView.widget({
  // ...your normal Advanced Charts options...
  snapshot_url: 'https://charts.example.com/snapshot'
});

Keep the endpoint stable. If you move storage later, preserve old URLs or provide redirects so previously shared links do not break.

Build the endpoint with Node.js and Express

The following implementation accepts the documented field, rejects missing uploads, writes files to an uploads directory, exposes that directory as static content, and returns a complete URL.

  1. Create a project and install dependencies.
  2. Create an uploads directory.
  3. Save the server as server.js.
  4. Run it behind HTTPS (or a TLS-terminating reverse proxy) and configure snapshot_url with the public address.
mkdir tradingview-snapshots
cd tradingview-snapshots
npm init -y
npm install express multer
mkdir uploads
const express = require('express');
const multer = require('multer');
const path = require('path');
const crypto = require('crypto');

const app = express();
const port = process.env.PORT || 3000;
const uploadDir = path.join(__dirname, 'uploads');

const storage = multer.diskStorage({
  destination: (_req, _file, cb) => cb(null, uploadDir),
  filename: (_req, _file, cb) => {
    const name = `${Date.now()}-${crypto.randomUUID()}.png`;
    cb(null, name);
  }
});

const upload = multer({
  storage,
  limits: { fileSize: 15 * 1024 * 1024 },
  fileFilter: (_req, file, cb) => {
    cb(null, file.mimetype === 'image/png');
  }
});

app.use('/uploads', express.static(uploadDir, {
  immutable: true,
  maxAge: '1d'
}));

app.post('/snapshot', upload.single('preparedImage'), (req, res) => {
  if (!req.file) {
    return res.status(400).json({ error: 'preparedImage PNG is required' });
  }
  const base = `${req.protocol}://${req.get('host')}`;
  return res.status(200).send(`${base}/uploads/${encodeURIComponent(req.file.filename)}`);
});

app.listen(port, () => console.log(`Snapshot server listening on ${port}`));

The documented example returns HTTP 200 and a URL. Returning plain text, as above, is straightforward; if your integration expects JSON in your application wrapper, return an object containing the URL while preserving the library’s expected response format. Test the exact behavior in your chart build.

Test the upload independently

Use a known PNG before debugging the chart. The multipart field name must be exactly preparedImage.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -i -F preparedImage=@/path/to/your/image.png https://charts.example.com/snapshot

A successful response should contain a complete HTTPS URL. Open that URL from a separate network to verify that your static route, proxy, and firewall all permit access.

Storage, security, and retention decisions

Validate more than the filename

Do not trust a client-supplied extension or MIME type on a public upload endpoint. Restrict the request size, allow only PNG content, and inspect the file signature with an image parser if your threat model requires it. Use generated filenames rather than user-provided names.

Pick a durable storage layer

Local disk is adequate for a single process with persistent storage. Containers and autoscaling instances often have ephemeral filesystems, so use object storage or a shared volume in production. Ensure the returned URL remains valid after restarts and deployments.

Define access and deletion rules

TradingView leaves storage duration to the implementer. Decide whether links are public, signed, authenticated, or unlisted; document retention; and provide deletion or lifecycle expiration. If snapshots can contain account data, treat URLs as potentially sensitive and avoid predictable identifiers.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use HTTPS and proxy-safe URLs

Terminate TLS at your load balancer or reverse proxy, forward the original protocol correctly, and construct URLs from a trusted configured origin when possible. Blindly trusting the Host header can create malicious links in some deployments.

Calling the client capture APIs

Upload through the configured server

const url = await chartWidget.takeScreenshot();
// Depending on the library build, listen for onScreenshotReady
// to receive the URL returned by your snapshot endpoint.

Wire the library’s onScreenshotReady event in the widget configuration so your UI can display, copy, or share the returned URL.

Capture without a server

const canvas = await chartWidget.takeClientScreenshot();
const pngBlob = await new Promise(resolve => canvas.toBlob(resolve, 'image/png'));
if (!pngBlob) throw new Error('PNG encoding failed');
const downloadUrl = URL.createObjectURL(pngBlob);
const link = document.createElement('a');
link.href = downloadUrl;
link.download = 'tradingview-snapshot.png';
link.click();
URL.revokeObjectURL(downloadUrl);

Canvas capture is useful for immediate downloads or when your own API already handles uploads. It does not make TradingView host the file.

Common failures and fixes

Symptom Likely cause Fix
400 or “file required” Wrong field name or no multipart encoding Send preparedImage with -F or a multipart client; do not send JSON.
413 Payload Too Large Proxy or Multer limit is smaller than the image Raise limits deliberately, or reject oversized images with a clear message.
200 response but link is blank or relative Endpoint returned a path instead of a full URL Return an absolute HTTPS URL including scheme and host.
Link works locally but not externally Private host, firewall, ephemeral disk, or missing static route Deploy publicly, expose the upload directory or object bucket, and test from another network.
Browser CORS error Cross-origin request is not permitted Allow the chart application’s exact origin at the proxy or application layer; avoid wildcard credentials.
Images disappear after restart Container-local storage Use persistent volume or object storage and keep URLs stable.
Trading drawings missing Feature is disabled Enable snapshot_trading_drawings in the documented featuresets.
Snapshot controls are absent Toolbar featureset disabled Remove or change header_screenshot from disabled featuresets.

Operational checklist

  • Use a public HTTPS snapshot_url.
  • Accept POST multipart/form-data.
  • Read the PNG field preparedImage.
  • Enforce file-size and content validation.
  • Store files on durable storage.
  • Return the complete saved-image URL with HTTP 200.
  • Monitor upload errors, storage growth, and link availability.
  • Set retention, access, and deletion policies.
  • Test Download, Copy image, Copy link, Open in new tab, and Tweet image separately.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. One request captures a URL as PNG, JPEG, WebP, or PDF; it removes cookie banners, newsletter popups, and chat widgets before capture. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and response headers identify the page verdict and billing result. Its MCP tools let Claude, Cursor, or another MCP client call take_screenshot, get_page_info, and capture_pdf.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a public chart page, call the API directly:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo documentation for options such as full-page lazy-image loading, CSS selectors, device presets, retina scale, custom CSS or JavaScript, waits, request blocking, headers, cookies, geolocation, caching, signed links, async webhooks, bulk capture, and PDF controls. The free plan includes 1,000 screenshots each month with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.

Best Value
Id Rather Be Trading Stock Trading Chart
  • 【Charming Art Tabletop Decor】Designed with minimalist yet creative aesthetics and fashionable artistic details. This desktop ornament is an excellent gift pick for relatives, friends, colleagues and partners. Perfect for wedding ceremonies, housewarming, birthday celebrations, Christmas, New Year, Mother’s Day, Father’s Day, Memorial Day and various family gatherings.
  • 【APPLICABLE SCENE】Art decor is suitable for decorating the bedroom,living room, kitchen, office, Hotel, dining room, bathroom, bar etc. It will be a unique wall decorations to decorate your space and will be a focus on your Party. Or also makes it suitable to hang in living room, foyer, apartment, villa, kitchen, office, couple bedroom, guest room, bathroom, hall, lounge, dorm, hotel, restaurant, coffee, loft, gym, bar, etc.
  • 【High-Quality Wood Framed Art】Each art framed print is crafted on premium canvas and wrapped in a durable frame for long-lasting beauty. The framed art design adds texture and depth. Its sturdy build ensures it remains a centerpiece for years to come.
  • 【Charming Gift for the Holiday Season】Celebrate the spirit of this framed art set that doubles as a thoughtful gift for family and friends. Perfect for anyone who loves nostalgic holiday decor, this art collection enhances any art canvas or vintage decor setup—bringing joy, warmth, and festive style to your home all season long.
  • 【Application】Elevate your holiday interior styling with this elegant crystal ornament. It fits seamlessly in living rooms, bedrooms, bathrooms and fireplace displays, infusing warm, joyful festive vibes into all your indoor spaces.

Which approach should you use?

Need Best fit
Download or process a screenshot immediately in your app takeClientScreenshot()
TradingView Copy link, Open in new tab, or Tweet image Your snapshot_url endpoint
Durable public links at scale Endpoint backed by persistent object storage
Capture arbitrary web pages without running browser infrastructure ScreenshotNeo API or MCP server

Frequently Asked Questions

Does TradingView store snapshot images for me?

No. Your snapshot_url endpoint stores the PNG and decides how long it remains available.

Can I implement snapshot_url in a language other than Node.js?

Yes. Any stack can implement the same POST multipart contract, read preparedImage, store the PNG, and return its complete public URL.

Is snapshot_url needed for Download image?

No. Download image and Copy image can use client-side capture; URL-based sharing actions require the server workflow.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read next

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.