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 Advanced Charts widget’s snapshot_url to an internet-accessible HTTPS endpoint. TradingView then sends a POST multipart/form-data request containing the chart PNG in a field named preparedImage. Your server validates and stores that file, serves it from a stable public URL, and returns the complete URL in its HTTP response. The client uses that URL for Copy link, Open in new tab, and Tweet image.

This guide implements that contract with Node.js and Express, then covers client-only capture, security, storage, deployment, troubleshooting, and an alternative that removes the browser-server setup.

What the TradingView snapshot API actually does

Advanced Charts can create a chart snapshot in the browser. Download and Copy image can work directly in the client. The server-backed actions—Copy link, Open in new tab, and Tweet image—need a place where the generated image can be saved and retrieved later.

Your application supplies that place through snapshot_url. It is your endpoint, not a TradingView-hosted storage service. TradingView sends the prepared PNG to that URL and expects your application to answer with the full URL of the saved image.

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.
#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.

The HTTP contract

  • Request: POST multipart/form-data.
  • File field: preparedImage.
  • Payload: the PNG generated from the chart.
  • Response: the complete, publicly reachable URL of the stored image.

The endpoint must be reachable from the browser running the chart. Use HTTPS in production, and ensure the returned hostname and path are accessible to the people who receive the link.

Choose the right capture path

Server-backed snapshots

Use takeScreenshot() when users need a URL that can be opened or shared after the chart page is gone. The library uploads the snapshot to your configured endpoint; when processing finishes, the onScreenshotReady event receives the resulting URL.

Client-only snapshots

Use takeClientScreenshot() when you only need an image in the current browser session. It returns a Promise<HTMLCanvasElement>, so your code can call canvas.toBlob() or canvas.toDataURL(), download the result, or send it to a storage service of your choice. This route avoids implementing snapshot_url, but it does not by itself create a durable shareable URL.

Implement the endpoint with Node.js and Express

1. Create the project

  1. Install a current supported Node.js release.
  2. Create a directory and initialize it: mkdir tradingview-snapshots && cd tradingview-snapshots && npm init -y.
  3. Install dependencies: npm install express multer cors.
  4. Create an uploads directory: mkdir uploads.

2. Add the server

The following implementation accepts only the expected multipart field, limits upload size, checks the detected MIME type, stores a generated filename, serves the directory, and returns an absolute URL.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const express = require('express');
const cors = require('cors');
const multer = require('multer');
const path = require('path');
const crypto = require('crypto');
const fs = require('fs');

const app = express();
const port = process.env.PORT || 3000;
const uploadDir = path.join(__dirname, 'uploads');
fs.mkdirSync(uploadDir, { recursive: true });

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

const upload = multer({
  dest: uploadDir,
  limits: { fileSize: 15 * 1024 * 1024, files: 1 },
  fileFilter: (req, file, cb) => {
    cb(null, file.mimetype === 'image/png');
  }
});

app.post('/snapshot', upload.single('preparedImage'), (req, res) => {
  if (!req.file) {
    return res.status(400).json({ error: 'preparedImage PNG is required' });
  }

  const finalName = `${crypto.randomUUID()}.png`;
  const finalPath = path.join(uploadDir, finalName);
  fs.renameSync(req.file.path, finalPath);

  const base = process.env.PUBLIC_BASE_URL || `${req.protocol}://${req.get('host')}`;
  const imageUrl = `${base.replace(//$/, '')}/uploads/${finalName}`;
  return res.status(200).json({ url: imageUrl });
});

app.use((err, req, res, next) => {
  if (err instanceof multer.MulterError) {
    return res.status(400).json({ error: err.message });
  }
  return res.status(500).json({ error: 'snapshot upload failed' });
});

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

Save this as server.js and run node server.js. Set PUBLIC_BASE_URL when the externally visible URL differs from the request host—for example, behind a reverse proxy. A successful response is HTTP 200 with a JSON object containing the saved image URL. If your client expects a bare URL rather than JSON, return the URL in the response format required by the specific library version you integrate; verify that behavior against your installed TradingView package.

3. Test the contract without TradingView

Use the documented multipart shape to isolate server problems:

curl -F preparedImage=@/path/to/your/image.png http://localhost:3000/snapshot

The response should contain an absolute URL. Open that URL from another device or network before configuring the chart. A local localhost URL is not usable by remote users.

4. Configure the widget

Set the widget configuration’s snapshot_url to your deployed endpoint, such as https://snapshots.example.com/snapshot. Configure the screenshot callback as appropriate for your integration and listen for onScreenshotReady when using the server-backed method.

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

Configure the snapshot toolbar and trading overlays

Hide or show the toolbar

Disable the header_screenshot featureset to remove the snapshot toolbar. Leave it enabled when users should access the predefined actions.

Include trading drawings

Enable the snapshot_trading_drawings featureset to include orders, positions, and executions in snapshots. Decide whether those overlays are appropriate for links that may be shared outside an authenticated account.

Built-in menu actions

The predefined actions are Download image, Copy image, Copy link, Open in new tab, and Tweet image. Custom menu options are not supported by the snapshot toolbar.

Storage, retention, and security decisions

Use durable storage for shareable links

The sample writes to local disk, which is suitable for development or a single persistent server. Containers and ephemeral hosts can delete local files during restarts or redeployments. For production, store objects in durable storage and return a stable HTTPS address, or place a persistent volume behind the service.

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

Define retention explicitly

TradingView leaves storage duration to the implementer. Decide how long links remain valid, then enforce it with lifecycle rules or a scheduled deletion job. Document whether deletion is automatic, manual, or tied to an account.

Validate and limit uploads

  • Accept only the preparedImage field and PNG content.
  • Enforce a size limit appropriate to your chart dimensions.
  • Generate server-side filenames; never use an uploaded filename as a path.
  • Store uploads outside executable directories.
  • Rate-limit the endpoint and log failures without recording sensitive request data.
  • Use authorization or signed, expiring URLs if snapshots contain private charts or trading information.

Handle cross-origin requests

The browser may call your endpoint from a different origin. Configure CORS for the chart origins you actually operate instead of allowing every origin indefinitely. Keep preflight responses and HTTPS configuration consistent at your reverse proxy.

Performance and reliability checklist

  • Return the URL only after the file is durably written; otherwise a user can receive a link that immediately fails.
  • Use a CDN or object-storage delivery path for frequently opened images.
  • Keep upload handling asynchronous if virus scanning or image processing is required.
  • Monitor 4xx and 5xx responses, storage failures, and link-not-found rates.
  • Use deterministic cleanup so abandoned snapshots do not consume unlimited storage.
  • Test large full-chart images, slow networks, duplicate uploads, and simultaneous users.

Troubleshooting common failures

400: preparedImage is missing

Cause: the field name or multipart encoding is wrong. Fix: send multipart/form-data with the exact field preparedImage; test with the curl command above.

The endpoint is never reached

Cause: snapshot_url points to a private host, an HTTP URL blocked by the page, or a path that differs from the deployed route. Fix: use the public HTTPS URL, confirm DNS and reverse-proxy routing, and inspect browser network logs.

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

The image URL returns 404

Cause: the file was saved on ephemeral disk, static serving is misconfigured, or cleanup removed it too soon. Fix: verify the file exists at the generated path, test /uploads/<filename> directly, and move production files to durable storage.

Links contain localhost or an internal hostname

Cause: the server constructed its base URL from an internal request host. Fix: set PUBLIC_BASE_URL to the externally reachable origin and configure trusted proxy settings when applicable.

Uploads are rejected as the wrong type

Cause: a proxy changed the content type or the client sent a non-PNG image. Fix: inspect the multipart headers and payload; do not simply remove validation, because file type and size controls are part of a safe endpoint.

Copy link works, but the image later disappears

Cause: retention policy or temporary storage. Fix: define a documented retention period and use durable storage with lifecycle rules that match it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.
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 GET request returns a 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 server provides take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients.

For a direct image request, see the ScreenshotNeo API documentation:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

The Free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 shots, and every feature is included on every plan. Sign up for the free plan to try it.

Frequently Asked Questions

Does TradingView host the snapshot images for my application?

No. Your snapshot_url endpoint and storage system host the uploaded PNG and determine how long its URL remains available.

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

Can I implement snapshot_url without Node.js?

Yes. Any server stack that accepts multipart/form-data, reads preparedImage, stores the PNG, serves it publicly, and returns its full URL can implement the contract.

When should I use takeClientScreenshot()?

Use it when the image only needs to be downloaded, displayed, or processed in the current browser session and you do not need TradingView to produce a shareable stored URL.

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.