Ticket Price Compare

v1.2.6

Compare real-time flight and train ticket prices across major platforms with direct booking links, real-time train availability, and discount condition details.

0· 205·0 current·0 all-time
byAmurtiger@amurtiger01

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for amurtiger01/ticket-price-compare.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Ticket Price Compare" (amurtiger01/ticket-price-compare) from ClawHub.
Skill page: https://clawhub.ai/amurtiger01/ticket-price-compare
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install ticket-price-compare

ClawHub CLI

Package manager switcher

npx clawhub@latest install ticket-price-compare
Security Scan
Capability signals
CryptoCan make purchasesRequires OAuth tokenRequires sensitive credentials
These labels describe what authority the skill may exercise. They are separate from suspicious or malicious moderation verdicts.
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (compare flight/train prices, provide booking links) aligns with the included script and declared network targets (12306, Ctrip, Qunar, Firecrawl, Tequila, Amadeus). Optional env vars (FIRECRAWL_API_KEY, TEQUILA_API_KEY, AMADEUS_*) are relevant to enhanced data sources. Minor inconsistency: release notes mention an opt-in TICKET_ALLOW_UNVERIFIED_SSL flag and the manifest claims it is declared, but the SKILL.md frontmatter shown earlier does not list it — this is a documentation/manifest mismatch rather than evidence of malicious behavior.
Instruction Scope
SKILL.md tells the agent to run the packaged Python script and documents which domains will be queried. Runtime instructions only access network endpoints and optional environment variables relevant to fetching ticket data; they do not instruct reading unrelated local files or harvesting other secrets.
Install Mechanism
No install specification is provided (instruction-only plus bundled script). The script uses Python stdlib (urllib, ssl) and optionally attempts to import the Amadeus SDK. README notes an optional pip install for Amadeus SDK — reasonable and optional. No downloads from untrusted URLs or extract/install steps are present.
Credentials
Declared environment variables are optional and appropriate for the described fallbacks/enhancements (Firecrawl for JS rendering; Tequila/Amadeus for additional flight data). There are no unexpected SECRET/TOKEN env vars unrelated to travel data. One caution: release notes refer to a TICKET_ALLOW_UNVERIFIED_SSL opt-in toggle (re-enables unverified SSL previously used); enabling such a flag would reduce security and should only be done knowingly on trusted networks.
Persistence & Privilege
The skill is not forced-always, does not request persistent system-level privileges, and does not modify other skills or global agent config. Autonomous invocation remains enabled by default (platform normal) but does not by itself increase the skill's scope beyond network requests and local script execution.
Assessment
This skill appears to do what it says: run the provided Python script which scrapes booking sites and queries 12306, optionally using Firecrawl/Tequila/Amadeus keys if you provide them. Before using: (1) review scripts/ticket_search.py yourself (it will execute on your machine and perform network requests), (2) don't set any environment variable you don't trust—especially avoid enabling any SSL-unverified fallback flag unless you understand the network risks, (3) be aware that providing a FIRECRAWL_API_KEY or other API keys means the script will send requests to those third-party APIs (and rendered page HTML may pass through them), and (4) if running in a sensitive environment (contains other secrets or internal network access), run the script in an isolated environment/container or inspect the full code for data-leakage before running.

Like a lobster shell, security has layers — review code before you run it.

latestvk972mf1denpxc9n9n460yzrn2n85g5t4
205downloads
0stars
9versions
Updated 2d ago
v1.2.6
MIT-0

Ticket Price Compare - Multi-Platform Ticket Price Comparison

Overview

This skill enables real-time comparison of flight and train ticket prices. It fetches real-time train availability via 12306 (no API key needed), and uses Firecrawl to render Ctrip JS pages for detailed flight data when FIRECRAWL_API_KEY is set. It also generates direct search links for all major booking platforms and WeChat mini program quick links for convenient mobile search. Tequila/Amadeus APIs are available as optional fallbacks for users who already have keys. Discount conditions and restrictions are clearly listed separately.

Data Sources

Firecrawl + Ctrip (Primary for Flight Data, Optional API Key)

  • Uses Firecrawl's /v2/scrape API to render Ctrip's JavaScript-heavy flight search pages
  • PC page (primary): Returns individual flight numbers, times, aircraft types, and prices
  • Mobile H5 page (fallback): Returns price calendar with daily lowest prices across dates
  • Requires FIRECRAWL_API_KEY environment variable. Register at firecrawl.dev
  • Falls back gracefully to direct scraping if not configured

Ctrip Direct Scraping (No API Key Needed)

  • Attempts direct HTTP request to Ctrip flight search pages
  • No registration or API key required - works out of the box
  • Limited data: Ctrip renders pages via JavaScript, so direct scraping may not always return prices. In that case, platform links are provided for manual search.

12306 (Train Tickets, No API Key Needed)

  • Uses 12306 public leftTicket/queryZ endpoint for real-time train availability
  • Uses 12306 public queryTicketPrice endpoint for actual fares per seat type
  • Supports major Chinese cities with station code auto-mapping

Optional APIs (For Existing Key Holders Only)

  • Kiwi.com Tequila API: If TEQUILA_API_KEY is set (registration may no longer be available)
  • Amadeus API: If AMADEUS_CLIENT_ID + AMADEUS_CLIENT_SECRET are set (registration is closed)
  • These are used as fallbacks only when web scraping returns no results

Core Capabilities

1. Flight Ticket Search

python scripts/ticket_search.py "<departure>" "<arrival>" "<date>" flight
  • Domestic: python scripts/ticket_search.py "Beijing" "Shanghai" "2026-05-01" flight
  • International: python scripts/ticket_search.py "Shanghai" "Tokyo" "2026-06-15" flight

Data sources (in order of priority):

  1. Firecrawl + Ctrip PC page (if FIRECRAWL_API_KEY set) - Best quality: individual flights, times, aircraft, prices
  2. Firecrawl + Ctrip Mobile H5 (fallback) - Price calendar with daily lowest prices
  3. Ctrip Direct Scraping (no API key, limited data)
  4. Tequila API (if API key configured)
  5. Amadeus API (if API keys configured)

Covered domestic platforms: Ctrip, Qunar, Fliggy, Tongcheng, Tuniu

Covered international platforms: Skyscanner, Google Flights, Kayak, Momondo, Expedia, Booking.com

Covered airline official sites: 10 Chinese + 13 international airlines

2. Train Ticket Search with Real-Time Availability

python scripts/ticket_search.py "<departure>" "<arrival>" "<date>" train

Real-time data from 12306: Returns actual train schedules with:

  • Train code & type (High-Speed/EMU/Express/Fast)
  • Departure/arrival stations & times
  • Duration
  • Available seat types & counts (Business Class/First Class/Second Class/Hard Sleeper/Hard Seat etc.)
  • Actual fares per seat type

3. Combined Search (Flight + Train)

python scripts/ticket_search.py "<departure>" "<arrival>" "<date>" all

Train results are automatically excluded for international routes.

Output Sections

The script generates structured output with these sections (in order):

  1. Route Summary - Departure, arrival, date, route type
  2. Data Source Status - Whether Firecrawl/scraping/APIs returned live data
  3. Real-Time Flight Prices - Table of flight offers with prices (if available)
  4. Transfer Details - Multi-segment flight details (if any transfers)
  5. Flight Discount Conditions - Refund/change rules, baggage limits, cabin restrictions
  6. Real-Time Train Info - Table of actual trains with seat availability and fares (if domestic)
  7. Train Discount Conditions - Student tickets, child tickets, change rules
  8. Platform Links - Direct search URLs for all booking platforms
  9. Airline Official Sites - Direct links to airline websites
  10. WeChat Mini Program Quick Links - Mobile H5 links + WeChat mini program search tips for Ctrip/Fliggy/Tongcheng/Qunar and major airlines
  11. Search Tips - Route-specific advice

Discount Conditions

Always include the dedicated "Discount Conditions / Restrictions" section. Reference references/platforms_guide.md for detailed per-platform discount conditions. Load this file when:

  • User asks about specific discount conditions
  • Presenting results that include discounted fares
  • User asks which platform has the best deals for their situation

Workflow

  1. Collect query parameters: Get departure city, arrival city, and travel date. If date not specified, ask. Default ticket type to "all".

  2. Execute search: Run scripts/ticket_search.py with the parameters.

  3. Present results: Show the complete output from the script. IMPORTANT: Do NOT summarize or omit train ticket price information. Always include:

    • Train ticket prices - The "票价(余票)" column contains actual fares like 二等座¥305(有) / 一等座¥488(12). This is real-time pricing data from 12306 and MUST be shown to the user.
    • Flight prices (if available from Firecrawl, scraping, or API)
    • All platform links for comparison
    • Discount conditions section
    • Search tips
  4. If no flight prices returned: Inform the user that real-time flight prices could not be fetched automatically, and recommend clicking the platform links to compare prices manually. Always mention that 12306 train data with real-time prices is available for domestic routes.

  5. When user asks for "all" or combined search: Present train results and flight results side by side. Do NOT skip or truncate the train price table even when flight data is extensive.

Date Flexibility

If a user asks for "cheapest dates" or "price trends":

  • Run the script with multiple date parameters to compare
  • For domestic flights: Also suggest Ctrip/Qunar price calendar features
  • For international flights: Suggest Skyscanner "cheapest month" or Google Flights date grid

Important Notes

  • Primary method: Firecrawl + Ctrip (if API key set) - renders JS pages, gets detailed flight data
  • Fallback scraping: Direct Ctrip HTTP request - no API key needed, but limited data due to JS rendering
  • Fallback APIs: Tequila/Amadeus - only for users who already have keys; registration is closed for new users
  • Without any flight data: Platform search links are always provided (users click to see prices)
  • 12306 train data is always real-time (no API key needed)
  • SSL verification: All connections use full TLS verification. 12306 endpoints never bypass SSL — if certificate verification fails, train data is unavailable for that request but all other features (flight search, platform links) still work.
  • Firecrawl proxy: Uses proxy: "basic" for optimal reliability with Chinese booking sites
  • Prices vary in real-time; recommend checking 2-3 platforms for confirmation
  • Airline official websites sometimes offer exclusive prices not available on OTA platforms
  • Always remind users about potential discount conditions before booking

Comments

Loading comments...