firecrawl icon indicating copy to clipboard operation
firecrawl copied to clipboard

feat(playwright): expose timezone in scrape result and allow specifying timezone

Open Fizza-Mukhtar opened this issue 8 months ago • 0 comments

Summary

Fixes #2383

Adds timezone support to the self-hosted Playwright scraping path.

Changes

  • playwright-service-ts/api.ts: Added timezone field to UrlModel, passes timezoneId to Playwright browser context, returns actual browser timezone in response
  • engines/playwright/index.ts: Forwards meta.options.location.timezone to playwright microservice request body, adds timezone to response schema and return value

How to test

POST /scrape
{
  "url": "https://www.timeanddate.com/worldclock/",
  "location": {
    "country": "US",
    "timezone": "America/New_York"
  }
}

Response will include "timezone": "America/New_York"

Notes

  • Fire-engine path already handled timezone separately
  • This fix closes the gap for self-hosted Playwright users
  • Falls back gracefully if timezone not specified

Summary by cubic

Adds timezone support to the self-hosted Playwright scraper so clients can set an IANA timezone and receive the resolved timezone in the response. Closes #2383.

  • New Features
    • API: Accepts location.timezone in scrape requests and forwards it to the Playwright service.
    • Playwright service: Validates the timezone, sets it as timezoneId in the browser context, and includes the resolved timezone in the response.
    • Optional field; if not provided, the browser default timezone is used.

Written for commit c2e800b4d2631b22a689a5c0d43a310bc006e71f. Summary will update on new commits.

Fizza-Mukhtar avatar Mar 03 '26 16:03 Fizza-Mukhtar