KS
Killer-Skills

retail-provider-fix — how to use retail-provider-fix how to use retail-provider-fix, retail-provider-fix setup guide, retail-provider-fix alternative, retail-provider-fix vs StakTrakr, fixing scraping failures in StakTrakr, configuring providers.json for retail-provider-fix, installing retail-provider-fix, retail-provider-fix diagnostic tools, StakTrakr retail pipeline optimization

v1.0.0
GitHub

About this Skill

Perfect for Debugging Agents needing to resolve scraping failures in retail pipelines. retail-provider-fix is a technical solution for diagnosing and fixing scraping failures in the StakTrakr retail pipeline, utilizing a privacy-first approach.

Features

Runs Live Firecrawl Diagnostic via curl commands
Configures providers.json for customized dealer settings
Utilizes Fly.io container for seamless integration
Supports self-hosted Firecrawl at localhost:3002
Diagnoses scraping failures for individual dealers
Fixes issues in the StakTrakr retail pipeline

# Core Topics

lbruton lbruton
[2]
[1]
Updated: 2/26/2026

Quality Score

Top 5%
42
Excellent
Based on code quality & docs
Installation
SYS Universal Install (Auto-Detect)
Cursor IDE Windsurf IDE VS Code IDE
> npx killer-skills add lbruton/StakTrakr/retail-provider-fix

Agent Capability Analysis

The retail-provider-fix MCP Server by lbruton is an open-source Categories.community integration for Claude and other AI agents, enabling seamless task automation and capability expansion. Optimized for how to use retail-provider-fix, retail-provider-fix setup guide, retail-provider-fix alternative.

Ideal Agent Persona

Perfect for Debugging Agents needing to resolve scraping failures in retail pipelines.

Core Value

Empowers agents to diagnose and fix scraping failures for individual dealers using curl and JSON configurations from providers.json, enhancing the StakTrakr retail pipeline's reliability and efficiency.

Capabilities Granted for retail-provider-fix MCP Server

Debugging scraping failures for precious metals portfolio trackers
Automating diagnostics for individual dealers in the StakTrakr pipeline
Fixing issues using live Firecrawl diagnostics

! Prerequisites & Limits

  • Requires access to the Fly.io container and self-hosted Firecrawl at localhost:3002
  • Limited to the StakTrakr retail pipeline and providers.json configuration
Project
SKILL.md
7.8 KB
.cursorrules
1.2 KB
package.json
240 B
Ready
UTF-8
SKILL.md
Readonly

Retail Provider Fix

Diagnose and fix scraping failures for individual dealers in the StakTrakr retail pipeline. All code lives in StakTrakrApi/devops/fly-poller/. All URL config is in providers.json on the api branch.


Step 1 — Live Firecrawl Diagnostic

Run directly inside the Fly.io container against the self-hosted Firecrawl at localhost:3002:

bash
1# Substitute URL from providers.json for the failing vendor/coin 2fly ssh console -a staktrakr -C "curl -s -X POST http://localhost:3002/v1/scrape \ 3 -H 'Content-Type: application/json' \ 4 -d '{\"url\":\"PROVIDER_URL_HERE\",\"formats\":[\"markdown\"],\"waitFor\":6000,\"onlyMainContent\":false}' \ 5 | python3 -c \"import sys,json; d=json.load(sys.stdin); \ 6 md=d.get('data',{}).get('markdown',''); \ 7 w=d.get('data',{}).get('warning',''); \ 8 print('WARNING:',w); print('LEN:',len(md)); print(md[:5000])\""

For home poller, replace fly ssh console -a staktrakr -C with ssh homepoller:

bash
1ssh homepoller "curl -s -X POST http://localhost:3002/v1/scrape ..."

Step 2 — Interpret the Output

SymptomMeaningFix category
warning: waitFor not supportedSelf-hosted Firecrawl ignores waitFor — JS never rendersForce Playwright path (see §4)
Markdown contains only "Loading..."Product table is JS-rendered, not in static HTMLForce Playwright path
Redirected to homepage URL in metadataBot detection — page is blockedPlaywright + residential proxy (see §5)
Spot prices appear before product priceMARKDOWN_HEADER_SKIP_PATTERNS not matchingUpdate header skip regex (see §3)
fractional_weight — 1/4 ozScraper found a fractional nav price before product priceUpdate MARKDOWN_CUTOFF_PATTERNS or force Playwright
page loaded, no pricePage renders but extraction regex doesn't matchUpdate extractPrice logic for that provider
out_of_stock — PRE-ORDERCorrect; item actually on pre-orderNo fix needed unless provider is in PREORDER_TOLERANT_PROVIDERS

Step 3 — Config Map in price-extract.js

All extraction config is in StakTrakrApi/devops/fly-poller/price-extract.js.

ConfigLine ~What it does
SLOW_PROVIDERS474Adds waitFor:6000 to Firecrawl AND waitForTimeout(8000) in Playwright fallback
MARKDOWN_HEADER_SKIP_PATTERNS157Regex matching the site header/nav — cuts everything BEFORE the match
MARKDOWN_CUTOFF_PATTERNS132Array of regexes — cuts everything AFTER the first match (removes related products, carousels)
PREORDER_TOLERANT_PROVIDERS134Providers where "Pre-Order" text should NOT count as OOS
USES_AS_LOW_AS117Providers that use "As Low As" as their primary price indicator (currently empty)
FBP_DEALER_NAME_MAP196Maps FindBullionPrices dealer display names → provider IDs
onlyMainContent485Firecrawl flag — set false for JMBullion to avoid missing the price table

URL changes go in providers.json on the api branch — NOT in price-extract.js. Both pollers auto-sync providers.json before every run via curl ... /api/data/retail/providers.json.


Step 4 — Self-Hosted Firecrawl waitFor Not Supported

This is the current state (confirmed Feb 2026): The self-hosted Firecrawl container does not support the waitFor parameter. It returns the static/pre-render HTML immediately.

Consequence: All JS-heavy SPAs (JMBullion, BullionExchanges, Monument Metals) get unrendered HTML from Firecrawl. Monument Metals and HeroBullion recover via the Playwright fallback. JMBullion does NOT recover because fractional_weight detection fires on the pre-render content and exits without triggering Playwright.

Fix options (in order of preference):

  1. Upgrade Firecrawl to a version that supports waitFor — check ghcr.io/firecrawl/firecrawl:latest changelog
  2. Force Playwright path for specific providers — add them to a PLAYWRIGHT_ONLY_PROVIDERS set that skips Firecrawl entirely
  3. Treat fractional_weight as Playwright trigger — same as price === null in the fallback condition

Step 5 — Bot Detection (BullionExchanges Pattern)

When Firecrawl returns a redirect to the site's homepage with only a banner image, bot detection is active.

Diagnosis: url in response metadata differs from sourceURL. e.g., sourceURL = product page, url = bullionexchanges.com.

Current status: BullionExchanges redirects ALL headless browser requests to homepage.

Fix options:

  • Playwright with residential proxy chain (HOME_PROXY_URL_2 → Webshare) — verify tinyproxy ConnectPort allows 443
  • Add browser stealth headers: real user-agent, Accept-Language, Sec-Fetch-* headers
  • If Tailscale exit node is active, ALL traffic routes via home residential IP — verify tailscale status in container before debugging further

Step 6 — Test Single Vendor (Dry Run)

From inside the container or home LXC:

bash
1# Fly.io — SSH in then run 2fly ssh console -a staktrakr 3cd /app 4DATA_DIR=/data/staktrakr-api-export/data \ 5FIRECRAWL_BASE_URL=http://localhost:3002 \ 6PLAYWRIGHT_LAUNCH=1 \ 7COINS=ase PROVIDERS=jmbullion \ 8DRY_RUN=1 node price-extract.js 9 10# Filter to multiple vendors 11COINS=ase,age PROVIDERS=jmbullion,bullionexchanges DRY_RUN=1 node price-extract.js

A successful result shows ✓ jmbullion: $XXX.XX (playwright) or ✓ jmbullion: $XXX.XX (firecrawl).


Step 7 — Deploy the Fix

After verifying the fix in dry-run:

bash
1# Fly.io — redeploy container (required for price-extract.js changes) 2cd /Volumes/DATA/GitHub/StakTrakrApi/devops/fly-poller 3fly deploy -a staktrakr 4 5# Home LXC — no deploy needed; run-home.sh reads price-extract.js directly 6# Just commit + pull on the home server: 7# git pull origin main && (restart cron if needed) 8 9# providers.json URL changes — push to api branch 10git checkout api 11# edit data/retail/providers.json 12git add data/retail/providers.json && git commit -m "fix(providers): update VENDOR urls" 13git push origin api 14# Both pollers pick this up automatically on next run (no redeploy needed)

Common Provider Failure Patterns

JMBullion — fractional_weight

Cause: Firecrawl's waitFor not supported → product table renders as "Loading..." → no price → but header skip exposes fractional nav links or spot prices that trigger false fractional_weight detection. Fix: Force Playwright path; verify MARKDOWN_HEADER_SKIP_PATTERNS.jmbullion still matches the header timestamp format.

BullionExchanges — page loaded, no price

Cause: Bot detection redirects to homepage; Firecrawl gets one-line banner. Playwright fallback also redirected. Fix: Check tinyproxy HTTPS CONNECT config; use Playwright with stealth headers.

Monument Metals — out_of_stock — PRE-ORDER

Cause: Coin legitimately on pre-order (common for new-year coins Jan–Mar). Fix: Update providers.json URL to a different in-stock coin, OR wait for inventory to arrive.

SDB — wrong price from "Add on Items" carousel

Cause: sdbullion was in USES_AS_LOW_AS; carousel prices bled through. Fix (applied 2026-02-20): sdbullion removed from USES_AS_LOW_AS; MARKDOWN_CUTOFF_PATTERNS.sdbullion added.


Firecrawl Engine Capabilities (Self-Hosted)

The self-hosted container uses Firecrawl's basic engine (not playwright). Capabilities:

FeatureSupported
Static HTML fetch
waitFor (JS wait)❌ (silently ignored, warning in response)
onlyMainContent
formats: markdown
Proxy (PROXY_SERVER)✅ via playwright-service
BLOCK_MEDIA✅ via playwright-service env

To check current Firecrawl version in container:

bash
1fly ssh console -a staktrakr -C "node -e \"const p=require('/opt/firecrawl/package.json'); console.log(p.version)\""

Related Skills

Looking for an alternative to retail-provider-fix or building a Categories.community AI Agent? Explore these related open-source MCP Servers.

View All

widget-generator

Logo of f
f

widget-generator is an open-source AI agent skill for creating widget plugins that are injected into prompt feeds on prompts.chat. It supports two rendering modes: standard prompt widgets using default PromptCard styling and custom render widgets built as full React components.

149.6k
0
Design

chat-sdk

Logo of lobehub
lobehub

chat-sdk is a unified TypeScript SDK for building chat bots across multiple platforms, providing a single interface for deploying bot logic.

73.0k
0
Communication

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
Communication

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
Communication