Renfe Scraper - Spanish Train Tickets & Prices avatar

Renfe Scraper - Spanish Train Tickets & Prices

Pricing

from $1.20 / 1,000 result scrapeds

Go to Apify Store
Renfe Scraper - Spanish Train Tickets & Prices

Renfe Scraper - Spanish Train Tickets & Prices

Scrape train schedules, prices, and availability from Renfe (renfe.com), Spain's national railway. Search AVE high-speed, Alvia, Media Distancia, and Cercanias routes. No login or cookies needed.

Pricing

from $1.20 / 1,000 result scrapeds

Rating

0.0

(0)

Developer

Studio Amba

Studio Amba

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

7 days ago

Last modified

Categories

Share

Renfe Scraper

Scrape train schedules, prices, and availability from Renfe, Spain's national railway operator. Extract data for AVE high-speed, Alvia, AVLO low-cost, Media Distancia, and regional train services. No login or cookies required.

How to scrape Renfe data

Renfe is Spain's national railway company, operating over 5,000 trains daily across the country. This scraper extracts structured train connection data including departure/arrival times, prices, train types, and seat classes directly from the Renfe website.

Use this actor to:

  • Monitor train prices across routes and dates
  • Compare fare classes (Turista, Turista Plus, Preferente)
  • Track AVE high-speed availability between major Spanish cities
  • Build travel datasets for research, analytics, or price comparison tools
  • Automate price alerts by scheduling regular runs

Why use this actor?

  • No login, no cookies, no API key needed — works out of the box
  • All train types covered — AVE, AVLO, Alvia, Altaria, Euromed, Media Distancia, Regional, Cercanias
  • Structured JSON output — clean, machine-readable data ready for analysis
  • Runs on Apify platform — scheduling, API access, webhooks, and integrations included
  • Proxy rotation — residential proxies for reliable access without blocking

Input

FieldTypeRequiredDefaultDescription
originStringNoMadridDeparture city or station name
destinationStringNoBarcelonaArrival city or station name
departureDateStringNoTomorrow+2Travel date in YYYY-MM-DD format
maxResultsIntegerNo50Maximum number of connections to return
proxyConfigurationObjectNoResidential ESProxy settings for reliability

Example input

{
"origin": "Madrid",
"destination": "Barcelona",
"departureDate": "2026-07-15",
"maxResults": 30,
"proxyConfiguration": {
"useApifyProxy": true,
"apifyProxyGroups": ["RESIDENTIAL"],
"apifyProxyCountry": "ES"
}
}
  • Madrid to Barcelona (AVE high-speed, ~2.5h)
  • Madrid to Sevilla (AVE, ~2.5h)
  • Madrid to Valencia (AVE, ~1.5h)
  • Barcelona to Valencia (Euromed/AVE, ~3h)
  • Madrid to Malaga (AVE, ~2.5h)
  • Madrid to Zaragoza (AVE, ~1.25h)

Output

Each result contains:

FieldTypeExample
originString"Madrid"
destinationString"Barcelona"
departureTimeString"08:00"
arrivalTimeString"10:30"
durationString"2h 30min"
trainTypeString"AVE"
trainNumberString"03091"
priceNumber35.50
currencyString"EUR"
seatClassString"Turista"
carrierString"Renfe"
urlStringLink to search results
scrapedAtStringISO 8601 timestamp

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel from the Output tab.

Example output

{
"origin": "Madrid",
"destination": "Barcelona",
"departureTime": "08:00",
"arrivalTime": "10:30",
"duration": "2h 30min",
"trainType": "AVE",
"trainNumber": "03091",
"price": 35.50,
"currency": "EUR",
"seatClass": "Turista",
"carrier": "Renfe",
"url": "https://www.renfe.com/es/en",
"scrapedAt": "2026-06-09T14:30:00.000Z"
}

How much does it cost to scrape Renfe?

This actor is a lightweight HTTP scraper (no browser), so it runs fast and cheap. It costs $0.02 per run plus $0.002 per result, regardless of proxy type.

Use caseEstimated cost
Single route search (50 trains)~$0.12
Daily monitoring of 10 routes (50 trains each)~$1.20/day
Weekly price comparison (50 routes)~$0.50-1.00/week

Costs may vary based on proxy usage and actor execution time.

Tips

  • Use Spanish proxy — Set apifyProxyCountry to ES for best results. Renfe may show different availability to non-Spanish IPs.
  • Book dates in advance — Renfe releases tickets 60-90 days ahead. Searching too far in the future may return no results.
  • Schedule runs — Set up daily or weekly runs to track price changes over time.
  • Empty results? — Check the debug screenshot saved in the key-value store. Renfe's website changes frequently.
  • AVLO low-cost — Renfe's low-cost AVE service (AVLO) has limited availability and may not show on all routes.

Renfe train types

TypeServiceSpeed
AVEHigh-speed long distanceUp to 310 km/h
AVLOLow-cost high-speedUp to 310 km/h
AlviaLong distance (variable gauge)Up to 250 km/h
EuromedMediterranean corridorUp to 220 km/h
AltariaLong distance dieselUp to 200 km/h
Media DistanciaMedium distance regionalUp to 160 km/h
RegionalShort distanceUp to 120 km/h
CercaniasSuburban commuterUp to 100 km/h

Limitations

  • Renfe's website uses heavy JavaScript rendering and may change its structure without notice
  • Prices shown are indicative and may differ from final booking prices
  • Some connections may not be available for online booking
  • The scraper searches one route per run; use multiple runs for multiple routes
  • Results depend on Renfe's website availability and may occasionally return fewer results

FAQ

Is scraping Renfe legal? This actor extracts publicly available information from Renfe's website. Always review and comply with Renfe's Terms of Service before use.

Why are there no results? Renfe's website is heavily JavaScript-based and may block automated access. Try using residential proxies with a Spanish IP. Check the debug screenshot in the key-value store for more information.

Can I search return trips? Currently the actor searches one-way connections. Run the actor twice with swapped origin/destination for return trips.

How often should I run it? For price monitoring, daily runs are recommended. Renfe prices change frequently, especially for popular routes like Madrid-Barcelona.

Support

Found a bug or need a custom solution? Open an issue in the Issues tab or contact us directly.