Pine Script Publisher: Indicator URL not captured after successful publish
Resolved 💬 2 comments Opened Jan 24, 2026 by a12233 Closed Feb 28, 2026
Problem
After successfully publishing a Pine Script indicator to TradingView, the published script URL is not captured. The script IS published (confirmed by checking the TradingView profile), but the automation cannot retrieve the direct indicator URL (e.g., https://www.tradingview.com/script/XXXXXX/).
Current Behavior
- Script publishes successfully ("Script Published!" shown in UI)
- TradingView does NOT redirect to the script URL - page stays at
/chart/ - TradingView does NOT open a new tab with the script URL
- No script URL link appears on the page after publish
- Network response capture doesn't catch the script ID
What We Tried
1. Extended Polling (implemented)
- Poll current page URL for 15 attempts (30+ seconds)
- Check for new browser tabs
- Look for script links on the page
- Listen for frame navigation to
/script/
Result: URL never appeared - page stayed at /chart/H49k1B4r/ throughout all polls
2. Profile Page Navigation (removed per user request)
- Navigate to user's profile page to find the most recent script
- Slow and unreliable (30s+ timeout, often fails)
3. API Query (implemented but not tested successfully)
Added call to pine-facade.tradingview.com/pine-facade/list?filter=published to fetch user's published scripts and find the most recent one.
const scriptFromApi = await page.evaluate(async (expectedTitle) => {
const response = await fetch('https://pine-facade.tradingview.com/pine-facade/list?filter=published', {
credentials: 'include',
})
const scripts = await response.json()
// Find matching script by title or return most recent
const targetScript = scripts.find(s => s.scriptName?.includes(expectedTitle)) || scripts[0]
return targetScript?.scriptIdPart ? `https://www.tradingview.com/script/${targetScript.scriptIdPart}/` : null
}, title)
Result: Not fully tested - machine suspended during test
Logs from Test v27
[TV Combined] Poll 1/15: Current URL: https://www.tradingview.com/chart/H49k1B4r/
[TV Combined] Poll 2/15: Current URL: https://www.tradingview.com/chart/H49k1B4r/
...
[TV Combined] Poll 15/15: Current URL: https://www.tradingview.com/chart/H49k1B4r/
[TV Combined] Script published but could not capture URL
[ValidationLoop] Script published successfully: https://www.tradingview.com/u/lirex14/#published-scripts
Proposed Solutions
- API Query on Every Poll - Call the pine-facade API more frequently during polling, not just on the last attempt
- Network Response Parsing - Improve parsing of the publish API response to extract the script ID directly when the publish request completes
- Success Dialog Scraping - After clicking final publish, TradingView may show a success dialog/toast that contains the script URL - parse this
Environment
- Fly.io deployment with Puppeteer/Chromium
- TradingView automation via headless browser
- Session authenticated via service account cookies
Files
src/server/tradingview.ts- Main automation logic (lines ~5530-5670 for URL capture)
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗