Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥
TypeScript aiai-agentsai-crawlerai-scrapingai-searchcrawlerdata-extractionhtml-to-markdownllmmarkdownscraperscrapingweb-crawlerweb-dataweb-data-extractionweb-scraperweb-scrapingweb-searchwebscraping
(sdks): added summary, fixed usage tests and v2 client for python
rafaelmmiller55e8d443fd74
diff --git a/apps/js-sdk/firecrawl/src/__tests__/e2e/v2/scrape.test.ts b/apps/js-sdk/firecrawl/src/__tests__/e2e/v2/scrape.test.tsindex df4d3f9b4..f7b54db65 100644--- a/apps/js-sdk/firecrawl/src/__tests__/e2e/v2/scrape.test.ts+++ b/apps/js-sdk/firecrawl/src/__tests__/e2e/v2/scrape.test.ts@@ -92,6 +92,13 @@ describe("v2.scrape e2e", () => {expect(doc).toBeTruthy();}, 90_000);+ test("summary format returns summary string", async () => {+ if (!client) throw new Error();+ const doc = await client.scrape("https://firecrawl.dev", { formats: ["summary"] });+ expect(typeof doc.summary).toBe("string");+ expect((doc.summary || "").length).toBeGreaterThan(10);+ }, 90_000);+test.each([["markdown", "markdown"],["html", "html"],diff --git a/apps/js-sdk/firecrawl/src/__tests__/e2e/v2/search.test.ts b/apps/js-sdk/firecrawl/src/__tests__/e2e/v2/search.test.tsindex 1fe117196..3d8ecd4d1 100644--- a/apps/js-sdk/firecrawl/src/__tests__/e2e/v2/search.test.ts+++ b/apps/js-sdk/firecrawl/src/__tests__/e2e/v2/search.test.ts@@ -31,7 +31,16 @@ function collectTexts(entries: any[] | undefined): string[] {function isDocument(entry: Document | SearchResult | undefined | null): entry is Document {if (!entry) return false;const d = entry as Document;- return typeof d.markdown === 'string' || typeof d.html === 'string';+ return (+ typeof d.markdown === 'string' ||+ typeof d.rawHtml === 'string' ||+ typeof d.html === 'string' ||+ typeof d.links === 'object' ||+ typeof d.screenshot === 'string' ||+ typeof d.changeTracking === 'object' ||+ typeof d.summary === 'string' ||+ typeof d.json === 'object'+ );}describe("v2.search e2e", () => {@@ -221,5 +230,18 @@ describe("v2.search e2e", () => {expect(results).toBeTruthy();expect(Array.isArray(results.web) || results.web == null).toBe(true);}, 90_000);++ test("with summary format, documents include summary when present", async () => {+ if (!client) throw new Error();+ const results = await client.search("site:firecrawl.dev", {+ limit: 1,+ scrapeOptions: { formats: ["summary"] },+ });+ const docs = (results.web || []).filter(r => isDocument(r)) as Document[];+ if (docs.length > 0) {+ expect(typeof docs[0].summary).toBe("string");+ expect((docs[0].summary || "").length).toBeGreaterThan(5);+ }+ }, 90_000);});diff --git a/apps/js-sdk/firecrawl/src/__tests__/e2e/v2/usage.test.ts b/apps/js-sdk/firecrawl/src/__tests__/e2e/v2/usage.test.tsindex 3e0e103a8..7ea8506f3 100644--- a/apps/js-sdk/firecrawl/src/__tests__/e2e/v2/usage.test.ts+++ b/apps/js-sdk/firecrawl/src/__tests__/e2e/v2/usage.test.ts@@ -25,7 +25,7 @@ describe("v2.usage e2e", () => {test("get_credit_usage", async () => {const resp = await client.getCreditUsage();- expect(typeof resp.remaining_credits).toBe("number");+ expect(typeof resp.remainingCredits).toBe("number");}, 60_000);test("get_token_usage", async () => {diff --git a/apps/js-sdk/firecrawl/src/v2/methods/search.ts b/apps/js-sdk/firecrawl/src/v2/methods/search.tsindex 65e793140..0812bf7bf 100644--- a/apps/js-sdk/firecrawl/src/v2/methods/search.ts+++ b/apps/js-sdk/firecrawl/src/v2/methods/search.ts@@ -39,7 +39,16 @@ export async function search(http: HttpClient, request: SearchRequest): Promise<for (const item of arr) {if (item && typeof item === "object") {// If scraped page fields present, treat as Document; otherwise SearchResult- if ("markdown" in item || "html" in item || "rawHtml" in item || "links" in item || "screenshot" in item || "changeTracking" in item) {+ if (+ "markdown" in item ||+ "html" in item ||+ "rawHtml" in item ||+ "links" in item ||+ "screenshot" in item ||+ "changeTracking" in item ||+ "summary" in item ||+ "json" in item+ ) {results.push(item as Document);} else {results.push({ url: item.url, title: item.title, description: item.description } as SearchResult);diff --git a/apps/js-sdk/firecrawl/src/v2/methods/usage.ts b/apps/js-sdk/firecrawl/src/v2/methods/usage.tsindex 4138a70ec..37c3f73e0 100644--- a/apps/js-sdk/firecrawl/src/v2/methods/usage.ts+++ b/apps/js-sdk/firecrawl/src/v2/methods/usage.ts@@ -16,10 +16,10 @@ export async function getConcurrency(http: HttpClient): Promise<ConcurrencyCheckexport async function getCreditUsage(http: HttpClient): Promise<CreditUsage> {try {- const res = await http.get<{ success: boolean; data?: { remaining_credits: number } }>("/v2/team/credit-usage");+ const res = await http.get<{ success: boolean; data?: { remainingCredits?: number; remaining_credits?: number } }>("/v2/team/credit-usage");if (res.status !== 200 || !res.data?.success) throwForBadResponse(res, "get credit usage");const d = res.data.data || (res.data as any);- return { remaining_credits: d.remaining_credits };+ return { remainingCredits: d.remainingCredits ?? d.remaining_credits ?? 0 };} catch (err: any) {if (err?.isAxiosError) return normalizeAxiosError(err, "get credit usage");throw err;diff --git a/apps/js-sdk/firecrawl/src/v2/types.ts b/apps/js-sdk/firecrawl/src/v2/types.tsindex 88d983165..026389a6a 100644--- a/apps/js-sdk/firecrawl/src/v2/types.ts+++ b/apps/js-sdk/firecrawl/src/v2/types.ts@@ -164,6 +164,7 @@ export interface Document {html?: string;rawHtml?: string;json?: unknown;+ summary?: string;metadata?: DocumentMetadata;links?: string[];screenshot?: string;@@ -255,7 +256,7 @@ export interface ConcurrencyCheck {}export interface CreditUsage {- remaining_credits: number;+ remainingCredits: number;}export interface TokenUsage {diff --git a/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_batch_scrape.py b/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_batch_scrape.pyindex 675ae1866..436f508a1 100644--- a/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_batch_scrape.py+++ b/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_batch_scrape.py@@ -17,17 +17,17 @@ if not os.getenv("API_URL"):@pytest.mark.asyncioasync def test_async_batch_start_and_status():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- start = await client.v2.start_batch_scrape([+ start = await client.start_batch_scrape(["https://docs.firecrawl.dev","https://firecrawl.dev",], formats=["markdown"], max_concurrency=1)job_id = start.iddeadline = asyncio.get_event_loop().time() + 240- status = await client.v2.get_batch_scrape_status(job_id)+ status = await client.get_batch_scrape_status(job_id)while status.status not in ("completed", "failed", "cancelled") and asyncio.get_event_loop().time() < deadline:await asyncio.sleep(2)- status = await client.v2.get_batch_scrape_status(job_id)+ status = await client.get_batch_scrape_status(job_id)assert status.status in ("completed", "failed", "cancelled")@@ -35,7 +35,7 @@ async def test_async_batch_start_and_status():@pytest.mark.asyncioasync def test_async_batch_wait_minimal():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- job = await client.v2.batch_scrape([+ job = await client.batch_scrape(["https://docs.firecrawl.dev","https://firecrawl.dev",], formats=["markdown"], poll_interval=1, timeout=120)@@ -46,7 +46,7 @@ async def test_async_batch_wait_minimal():async def test_async_batch_wait_with_all_params():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))json_schema = {"type": "object", "properties": {"title": {"type": "string"}}, "required": ["title"]}- job = await client.v2.batch_scrape(+ job = await client.batch_scrape(["https://docs.firecrawl.dev","https://firecrawl.dev",@@ -70,10 +70,10 @@ async def test_async_batch_wait_with_all_params():@pytest.mark.asyncioasync def test_async_cancel_batch():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- start = await client.v2.start_batch_scrape([+ start = await client.start_batch_scrape(["https://docs.firecrawl.dev","https://firecrawl.dev",], formats=["markdown"], max_concurrency=1)- ok = await client.v2.cancel_batch_scrape(start.id)+ ok = await client.cancel_batch_scrape(start.id)assert ok is Truediff --git a/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_crawl.py b/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_crawl.pyindex 4193c2159..f174de6bb 100644--- a/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_crawl.py+++ b/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_crawl.py@@ -18,14 +18,14 @@ if not os.getenv("API_URL"):@pytest.mark.asyncioasync def test_async_crawl_start_and_status():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- start = await client.v2.start_crawl("https://docs.firecrawl.dev", limit=2)+ start = await client.start_crawl("https://docs.firecrawl.dev", limit=2)job_id = start.iddeadline = asyncio.get_event_loop().time() + 180- status = await client.v2.get_crawl_status(job_id)+ status = await client.get_crawl_status(job_id)while status.status not in ("completed", "failed") and asyncio.get_event_loop().time() < deadline:await asyncio.sleep(2)- status = await client.v2.get_crawl_status(job_id)+ status = await client.get_crawl_status(job_id)assert status.status in ("completed", "failed")@@ -39,7 +39,7 @@ async def test_async_crawl_with_all_params():"properties": {"title": {"type": "string"}},"required": ["title"],}- status = await client.v2.crawl(+ status = await client.crawl(url="https://docs.firecrawl.dev",prompt="Extract docs and blog",include_paths=["/docs/*", "/blog/*"],@@ -77,22 +77,22 @@ async def test_async_crawl_with_all_params():@pytest.mark.asyncioasync def test_async_start_crawl_with_options():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- start = await client.v2.start_crawl("https://docs.firecrawl.dev", limit=5, max_discovery_depth=2)+ start = await client.start_crawl("https://docs.firecrawl.dev", limit=5, max_discovery_depth=2)assert start.id is not None and start.url is not None@pytest.mark.asyncioasync def test_async_start_crawl_with_prompt():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- start = await client.v2.start_crawl("https://firecrawl.dev", prompt="Extract all blog posts", limit=3)+ start = await client.start_crawl("https://firecrawl.dev", prompt="Extract all blog posts", limit=3)assert start.id is not None and start.url is not None@pytest.mark.asyncioasync def test_async_get_crawl_status_shape():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- start = await client.v2.start_crawl("https://docs.firecrawl.dev", limit=3)- status = await client.v2.get_crawl_status(start.id)+ start = await client.start_crawl("https://docs.firecrawl.dev", limit=3)+ status = await client.get_crawl_status(start.id)assert status.status in ("scraping", "completed", "failed")assert status.completed >= 0assert status.expires_at is not None@@ -103,7 +103,7 @@ async def test_async_get_crawl_status_shape():@pytest.mark.asyncioasync def test_async_crawl_with_wait():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- job = await client.v2.crawl(url="https://docs.firecrawl.dev", limit=3, max_discovery_depth=2, poll_interval=1, timeout=120)+ job = await client.crawl(url="https://docs.firecrawl.dev", limit=3, max_discovery_depth=2, poll_interval=1, timeout=120)assert job.status in ("completed", "failed")assert job.completed >= 0 and job.total >= 0 and isinstance(job.data, list)@@ -111,7 +111,7 @@ async def test_async_crawl_with_wait():@pytest.mark.asyncioasync def test_async_crawl_with_prompt_and_wait():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- job = await client.v2.crawl(url="https://docs.firecrawl.dev", prompt="Extract all blog posts", limit=3, poll_interval=1, timeout=120)+ job = await client.crawl(url="https://docs.firecrawl.dev", prompt="Extract all blog posts", limit=3, poll_interval=1, timeout=120)assert job.status in ("completed", "failed")assert job.completed >= 0 and job.total >= 0 and isinstance(job.data, list)@@ -120,7 +120,7 @@ async def test_async_crawl_with_prompt_and_wait():async def test_async_crawl_with_scrape_options():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))scrape_opts = ScrapeOptions(formats=["markdown", "links"], only_main_content=False, mobile=True)- start = await client.v2.start_crawl("https://docs.firecrawl.dev", limit=2, scrape_options=scrape_opts)+ start = await client.start_crawl("https://docs.firecrawl.dev", limit=2, scrape_options=scrape_opts)assert start.id is not None@@ -129,51 +129,51 @@ async def test_async_crawl_with_json_format_object():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))json_schema = {"type": "object", "properties": {"title": {"type": "string"}}, "required": ["title"]}scrape_opts = ScrapeOptions(formats=[{"type": "json", "prompt": "Extract page title", "schema": json_schema}])- start = await client.v2.start_crawl("https://docs.firecrawl.dev", limit=2, scrape_options=scrape_opts)+ start = await client.start_crawl("https://docs.firecrawl.dev", limit=2, scrape_options=scrape_opts)assert start.id is not None@pytest.mark.asyncioasync def test_async_cancel_crawl():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- start = await client.v2.start_crawl("https://docs.firecrawl.dev", limit=3)- cancelled = await client.v2.cancel_crawl(start.id)+ start = await client.start_crawl("https://docs.firecrawl.dev", limit=3)+ cancelled = await client.cancel_crawl(start.id)assert cancelled is True@pytest.mark.asyncioasync def test_async_get_crawl_errors_and_invalid_job():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- start = await client.v2.start_crawl("https://docs.firecrawl.dev", limit=2)- errs = await client.v2.get_crawl_errors(start.id)+ start = await client.start_crawl("https://docs.firecrawl.dev", limit=2)+ errs = await client.get_crawl_errors(start.id)assert hasattr(errs, "errors") and hasattr(errs, "robots_blocked")with pytest.raises(Exception):- await client.v2.get_crawl_errors("invalid-job-id-12345")+ await client.get_crawl_errors("invalid-job-id-12345")@pytest.mark.asyncioasync def test_async_active_crawls():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- resp = await client.v2.active_crawls()+ resp = await client.active_crawls()assert hasattr(resp, "success") and hasattr(resp, "crawls")@pytest.mark.asyncioasync def test_async_active_crawls_with_running_crawl():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- start = await client.v2.start_crawl("https://docs.firecrawl.dev", limit=3)+ start = await client.start_crawl("https://docs.firecrawl.dev", limit=3)# fetch active crawls and assert our ID is listed- active = await client.v2.active_crawls()+ active = await client.active_crawls()ids = [c.id for c in active.crawls]assert start.id in ids# cleanup- await client.v2.cancel_crawl(start.id)+ await client.cancel_crawl(start.id)@pytest.mark.asyncioasync def test_async_crawl_params_preview():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- params = await client.v2.crawl_params_preview(+ params = await client.crawl_params_preview(url="https://docs.firecrawl.dev",prompt="Extract all blog posts and documentation",)diff --git a/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_extract.py b/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_extract.pyindex 353d385a3..211f63561 100644--- a/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_extract.py+++ b/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_extract.py@@ -16,7 +16,7 @@ if not os.getenv("API_URL"):@pytest.mark.asyncioasync def test_async_extract_minimal():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- res = await client.v2.extract(urls=["https://docs.firecrawl.dev"], prompt="Extract title")+ res = await client.extract(urls=["https://docs.firecrawl.dev"], prompt="Extract title")assert res is not None@@ -24,7 +24,7 @@ async def test_async_extract_minimal():async def test_async_extract_with_schema_and_options():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))schema = {"type": "object", "properties": {"title": {"type": "string"}}, "required": ["title"]}- res = await client.v2.extract(+ res = await client.extract(urls=["https://docs.firecrawl.dev"],prompt="Extract title",schema=schema,diff --git a/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_map.py b/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_map.pyindex 5920b7073..933bc7128 100644--- a/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_map.py+++ b/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_map.py@@ -16,7 +16,7 @@ if not os.getenv("API_URL"):@pytest.mark.asyncioasync def test_async_map_minimal():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- resp = await client.v2.map("https://docs.firecrawl.dev")+ resp = await client.map("https://docs.firecrawl.dev")assert hasattr(resp, "links") and isinstance(resp.links, list)if resp.links:first = resp.links[0]@@ -27,7 +27,7 @@ async def test_async_map_minimal():@pytest.mark.parametrize("sitemap", ["only", "include", "skip"])async def test_async_map_with_all_params(sitemap):client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- resp = await client.v2.map(+ resp = await client.map("https://docs.firecrawl.dev",search="docs",include_subdomains=True,diff --git a/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_scrape.py b/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_scrape.pyindex 70947f68e..fdea9affc 100644--- a/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_scrape.py+++ b/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_scrape.py@@ -17,7 +17,7 @@ if not os.getenv("API_URL"):@pytest.mark.asyncioasync def test_async_scrape_minimal():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- doc = await client.v2.scrape("https://docs.firecrawl.dev")+ doc = await client.scrape("https://docs.firecrawl.dev")assert isinstance(doc, Document)assert ((doc.markdown and len(doc.markdown) > 0)@@ -26,6 +26,7 @@ async def test_async_scrape_minimal():or (doc.links is not None)or (doc.screenshot is not None)or (doc.json is not None)+ or (doc.summary is not None))@@ -38,7 +39,7 @@ async def test_async_scrape_with_all_params():"properties": {"title": {"type": "string"}},"required": ["title"],}- doc = await client.v2.scrape(+ doc = await client.scrape("https://docs.firecrawl.dev",formats=["markdown",@@ -70,7 +71,7 @@ async def test_async_scrape_with_all_params():@pytest.mark.asyncioasync def test_async_scrape_with_options_markdown():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- doc = await client.v2.scrape(+ doc = await client.scrape("https://docs.firecrawl.dev",formats=["markdown"],only_main_content=False,@@ -82,7 +83,7 @@ async def test_async_scrape_with_options_markdown():@pytest.mark.asyncioasync def test_async_scrape_with_screenshot_action_viewport():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- doc = await client.v2.scrape(+ doc = await client.scrape("https://docs.firecrawl.dev",formats=[{"type": "screenshot", "full_page": False, "quality": 80, "viewport": {"width": 800, "height": 600}}],)@@ -96,10 +97,11 @@ async def test_async_scrape_with_screenshot_action_viewport():("raw_html", "raw_html"),("links", "links"),("screenshot", "screenshot"),+ ("summary", "summary"),])async def test_async_scrape_basic_formats(fmt, expect_field):client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- doc = await client.v2.scrape("https://docs.firecrawl.dev", formats=[fmt])+ doc = await client.scrape("https://docs.firecrawl.dev", formats=[fmt])assert isinstance(doc, Document)if expect_field == "markdown":assert doc.markdown is not None@@ -111,13 +113,15 @@ async def test_async_scrape_basic_formats(fmt, expect_field):assert isinstance(doc.links, list)elif expect_field == "screenshot":assert doc.screenshot is not None+ elif expect_field == "summary":+ assert doc.summary is not None@pytest.mark.asyncioasync def test_async_scrape_with_json_format_object():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))json_schema = {"type": "object", "properties": {"title": {"type": "string"}}, "required": ["title"]}- doc = await client.v2.scrape(+ doc = await client.scrape("https://docs.firecrawl.dev",formats=[{"type": "json", "prompt": "Extract page title", "schema": json_schema}],only_main_content=True,@@ -129,5 +133,5 @@ async def test_async_scrape_with_json_format_object():async def test_async_scrape_invalid_url():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))with pytest.raises(ValueError):- await client.v2.scrape("")+ await client.scrape("")diff --git a/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_search.py b/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_search.pyindex 85233859c..6d0b6daa9 100644--- a/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_search.py+++ b/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_search.py@@ -19,9 +19,22 @@ def _collect_texts(entries):def _is_document(entry) -> bool:try:from firecrawl.v2.types import Document- return isinstance(entry, Document) or hasattr(entry, 'markdown') or hasattr(entry, 'html')+ return isinstance(entry, Document) or \+ hasattr(entry, 'markdown') or \+ hasattr(entry, 'html') or \+ hasattr(entry, 'raw_html') or \+ hasattr(entry, 'json') or \+ hasattr(entry, 'screenshot') or \+ hasattr(entry, 'change_tracking') or \+ hasattr(entry, 'summary')except Exception:- return hasattr(entry, 'markdown') or hasattr(entry, 'html')+ return hasattr(entry, 'markdown') or \+ hasattr(entry, 'html') or \+ hasattr(entry, 'raw_html') or \+ hasattr(entry, 'json') or \+ hasattr(entry, 'screenshot') or \+ hasattr(entry, 'change_tracking') or \+ hasattr(entry, 'summary')load_dotenv()@@ -36,7 +49,7 @@ if not os.getenv("API_URL"):@pytest.mark.asyncioasync def test_async_search_minimal():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- data = await client.v2.search("What is the capital of France?")+ data = await client.search("What is the capital of France?")# Assert sections like sync testsassert hasattr(data, "web")assert hasattr(data, "news")@@ -54,7 +67,7 @@ async def test_async_search_minimal():@pytest.mark.asyncioasync def test_async_search_with_sources_and_limit():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- data = await client.v2.search("firecrawl", sources=["web", "news"], limit=3)+ data = await client.search("firecrawl", sources=["web", "news"], limit=3)# Sections presentassert hasattr(data, "web") and hasattr(data, "news") and hasattr(data, "images")# Web present, images absent, news optional but if present respects limit@@ -68,7 +81,7 @@ async def test_async_search_with_sources_and_limit():@pytest.mark.asyncioasync def test_async_search_with_all_params():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- data = await client.v2.search(+ data = await client.search("artificial intelligence",sources=["web", "news"],limit=3,@@ -121,7 +134,7 @@ async def test_async_search_with_all_params():async def test_async_search_minimal_content_check():"""Stronger assertion similar to sync: content check on a known query."""client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- data = await client.v2.search("What is the capital of France?")+ data = await client.search("What is the capital of France?")assert hasattr(data, "web") and data.web is not Nonenon_doc = [r for r in (data.web or []) if not _is_document(r)]if non_doc:@@ -132,7 +145,7 @@ async def test_async_search_minimal_content_check():@pytest.mark.asyncioasync def test_async_search_result_structure():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- data = await client.v2.search("test query", limit=1)+ data = await client.search("test query", limit=1)if data.web and len(data.web) > 0:result = data.web[0]assert hasattr(result, "url")@@ -147,11 +160,11 @@ async def test_async_search_result_structure():async def test_async_search_formats_flexibility():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))# list string- res1 = await client.v2.search("python programming", limit=1, scrape_options=ScrapeOptions(formats=["markdown"]))+ res1 = await client.search("python programming", limit=1, scrape_options=ScrapeOptions(formats=["markdown"]))# list objects- res2 = await client.v2.search("python programming", limit=1, scrape_options=ScrapeOptions(formats=[{"type": "markdown"}]))+ res2 = await client.search("python programming", limit=1, scrape_options=ScrapeOptions(formats=[{"type": "markdown"}]))# ScrapeFormats object- res3 = await client.v2.search("python programming", limit=1, scrape_options=ScrapeOptions(formats=ScrapeFormats(markdown=True)))+ res3 = await client.search("python programming", limit=1, scrape_options=ScrapeOptions(formats=ScrapeFormats(markdown=True)))assert isinstance(res1, SearchData) and hasattr(res1, "web")assert isinstance(res2, SearchData) and hasattr(res2, "web")assert isinstance(res3, SearchData) and hasattr(res3, "web")@@ -161,7 +174,7 @@ async def test_async_search_formats_flexibility():async def test_async_search_json_format_object():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))json_schema = {"type": "object", "properties": {"title": {"type": "string"}}, "required": ["title"]}- data = await client.v2.search(+ data = await client.search("site:docs.firecrawl.dev",limit=1,scrape_options={"formats": [{"type": "json", "prompt": "Extract page title", "schema": json_schema}]},diff --git a/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_usage.py b/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_usage.pyindex dbdcc9f42..42f1c2ce5 100644--- a/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_usage.py+++ b/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_usage.py@@ -16,20 +16,20 @@ if not os.getenv("API_URL"):@pytest.mark.asyncioasync def test_async_get_concurrency():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- conc = await client.v2.get_concurrency()+ conc = await client.get_concurrency()assert hasattr(conc, "concurrency") and hasattr(conc, "max_concurrency")@pytest.mark.asyncioasync def test_async_get_credit_usage():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- credits = await client.v2.get_credit_usage()+ credits = await client.get_credit_usage()assert hasattr(credits, "remaining_credits")@pytest.mark.asyncioasync def test_async_get_token_usage():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- tokens = await client.v2.get_token_usage()- assert hasattr(tokens, "total_tokens")+ tokens = await client.get_token_usage()+ assert hasattr(tokens, "remaining_tokens")diff --git a/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_watcher.py b/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_watcher.pyindex da48057df..10547b6ae 100644--- a/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_watcher.py+++ b/apps/python-sdk/firecrawl/__tests__/e2e/v2/aio/test_aio_watcher.py@@ -18,7 +18,7 @@ if not os.getenv("API_URL"):@pytest.mark.asyncioasync def test_async_watcher_crawl_progresses():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- start = await client.v2.start_crawl("https://docs.firecrawl.dev", limit=2)+ start = await client.start_crawl("https://docs.firecrawl.dev", limit=2)statuses = []async for snapshot in AsyncWatcher(client, start.id, kind="crawl", timeout=180):statuses.append(snapshot.status)@@ -30,7 +30,7 @@ async def test_async_watcher_crawl_progresses():@pytest.mark.asyncioasync def test_async_watcher_batch_progresses():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- start = await client.v2.start_batch_scrape([+ start = await client.start_batch_scrape(["https://docs.firecrawl.dev","https://firecrawl.dev",], formats=["markdown"], max_concurrency=1)diff --git a/apps/python-sdk/firecrawl/__tests__/e2e/v2/test_async.py b/apps/python-sdk/firecrawl/__tests__/e2e/v2/test_async.pyindex 5b5e237b3..a26d91b0e 100644--- a/apps/python-sdk/firecrawl/__tests__/e2e/v2/test_async.py+++ b/apps/python-sdk/firecrawl/__tests__/e2e/v2/test_async.py@@ -19,31 +19,24 @@ if not os.getenv("API_URL"):@pytest.mark.asyncioasync def test_async_scrape_minimal():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- doc = await client.v2.scrape("https://docs.firecrawl.dev")+ doc = await client.scrape("https://docs.firecrawl.dev")assert isinstance(doc, Document)# Accept any primary content or alternate outputs- assert (- (doc.markdown and len(doc.markdown) > 0)- or (doc.html and len(doc.html) > 0)- or (doc.raw_html and len(doc.raw_html) > 0)- or (doc.links is not None)- or (doc.screenshot is not None)- or (doc.json is not None)- )+ assert doc.markdown is not None and doc.markdown and len(doc.markdown) > 0@pytest.mark.asyncioasync def test_async_crawl_start_and_status():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- start = await client.v2.start_crawl("https://docs.firecrawl.dev", limit=2)+ start = await client.start_crawl("https://docs.firecrawl.dev", limit=2)job_id = start.id# Poll status until terminal or timeoutdeadline = asyncio.get_event_loop().time() + 180- status = await client.v2.get_crawl_status(job_id)+ status = await client.get_crawl_status(job_id)while status.status not in ("completed", "failed") and asyncio.get_event_loop().time() < deadline:await asyncio.sleep(2)- status = await client.v2.get_crawl_status(job_id)+ status = await client.get_crawl_status(job_id)assert status.status in ("completed", "failed")@@ -51,17 +44,17 @@ async def test_async_crawl_start_and_status():@pytest.mark.asyncioasync def test_async_batch_start_and_status():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- start = await client.v2.start_batch_scrape([+ start = await client.start_batch_scrape(["https://docs.firecrawl.dev","https://firecrawl.dev",], formats=["markdown"], max_concurrency=1)job_id = start.iddeadline = asyncio.get_event_loop().time() + 240- status = await client.v2.get_batch_scrape_status(job_id)+ status = await client.get_batch_scrape_status(job_id)while status.status not in ("completed", "failed", "cancelled") and asyncio.get_event_loop().time() < deadline:await asyncio.sleep(2)- status = await client.v2.get_batch_scrape_status(job_id)+ status = await client.get_batch_scrape_status(job_id)assert status.status in ("completed", "failed", "cancelled")@@ -69,12 +62,12 @@ async def test_async_batch_start_and_status():@pytest.mark.asyncioasync def test_async_usage_minimal():client = AsyncFirecrawl(api_key=os.getenv("API_KEY"), api_url=os.getenv("API_URL"))- conc = await client.v2.get_concurrency()+ conc = await client.get_concurrency()assert hasattr(conc, "concurrency") and hasattr(conc, "max_concurrency")- credits = await client.v2.get_credit_usage()+ credits = await client.get_credit_usage()assert hasattr(credits, "remaining_credits")- tokens = await client.v2.get_token_usage()- assert hasattr(tokens, "total_tokens")+ tokens = await client.get_token_usage()+ assert hasattr(tokens, "remaining_tokens")diff --git a/apps/python-sdk/firecrawl/__tests__/e2e/v2/test_scrape.py b/apps/python-sdk/firecrawl/__tests__/e2e/v2/test_scrape.pyindex b3aed132f..b7d6d8829 100644--- a/apps/python-sdk/firecrawl/__tests__/e2e/v2/test_scrape.py+++ b/apps/python-sdk/firecrawl/__tests__/e2e/v2/test_scrape.py@@ -28,6 +28,7 @@ class TestScrapeE2E:(doc.markdown is not None and len(doc.markdown) > 0)or (doc.html is not None and len(doc.html) > 0)or (doc.raw_html is not None and len(doc.raw_html) > 0)+ or (doc.summary is not None and len(doc.summary) > 0))# Metadata should exist with a source URL or title when availableassert doc.metadata is not None@@ -64,6 +65,7 @@ class TestScrapeE2E:("raw_html", "raw_html"),("links", "links"),("screenshot", "screenshot"),+ ("summary", "summary"),])def test_scrape_basic_formats(self, fmt, expect_field):"""Verify basic formats request succeeds and expected fields are present when applicable."""@@ -129,6 +131,7 @@ class TestScrapeE2E:"raw_html",{"type": "screenshot", "full_page": False, "quality": 70},{"type": "json", "prompt": "Extract title", "schema": json_schema},+ {"type": "summary" },],headers={"User-Agent": "E2E"},include_tags=["main"],diff --git a/apps/python-sdk/firecrawl/__tests__/e2e/v2/test_search.py b/apps/python-sdk/firecrawl/__tests__/e2e/v2/test_search.pyindex 7a5501331..85837f725 100644--- a/apps/python-sdk/firecrawl/__tests__/e2e/v2/test_search.py+++ b/apps/python-sdk/firecrawl/__tests__/e2e/v2/test_search.py@@ -21,9 +21,22 @@ def _collect_texts(entries):def _is_document(entry) -> bool:try:from firecrawl.v2.types import Document- return isinstance(entry, Document) or hasattr(entry, 'markdown') or hasattr(entry, 'html')+ return isinstance(entry, Document) or \+ hasattr(entry, 'markdown') or \+ hasattr(entry, 'html') or \+ hasattr(entry, 'raw_html') or \+ hasattr(entry, 'json') or \+ hasattr(entry, 'screenshot') or \+ hasattr(entry, 'change_tracking') or \+ hasattr(entry, 'summary')except Exception:- return hasattr(entry, 'markdown') or hasattr(entry, 'html')+ return hasattr(entry, 'markdown') or \+ hasattr(entry, 'html') or \+ hasattr(entry, 'raw_html') or \+ hasattr(entry, 'json') or \+ hasattr(entry, 'screenshot') or \+ hasattr(entry, 'change_tracking') or \+ hasattr(entry, 'summary')def test_search_minimal_request():results = firecrawl.search(@@ -135,7 +148,8 @@ def test_search_all_parameters():"type": "json","prompt": "Extract the title and description from the page","schema": schema- }+ },+ {"type": "summary"}],headers={"User-Agent": "Firecrawl-Test/1.0"},include_tags=["h1", "h2", "p"],diff --git a/apps/python-sdk/firecrawl/__tests__/e2e/v2/test_usage.py b/apps/python-sdk/firecrawl/__tests__/e2e/v2/test_usage.pyindex f3ea900ba..08e9c2f68 100644--- a/apps/python-sdk/firecrawl/__tests__/e2e/v2/test_usage.py+++ b/apps/python-sdk/firecrawl/__tests__/e2e/v2/test_usage.py@@ -22,7 +22,5 @@ class TestUsageE2E:def test_get_token_usage(self):resp = self.client.get_token_usage()- assert hasattr(resp, "prompt_tokens")- assert hasattr(resp, "completion_tokens")- assert hasattr(resp, "total_tokens")+ assert hasattr(resp, "remaining_tokens")diff --git a/apps/python-sdk/firecrawl/__tests__/unit/v2/methods/test_usage_types.py b/apps/python-sdk/firecrawl/__tests__/unit/v2/methods/test_usage_types.pyindex a6359cf4e..172c15ca1 100644--- a/apps/python-sdk/firecrawl/__tests__/unit/v2/methods/test_usage_types.py+++ b/apps/python-sdk/firecrawl/__tests__/unit/v2/methods/test_usage_types.py@@ -13,10 +13,6 @@ class TestUsageTypes:assert cu.remaining_credits == 123def test_token_usage_model(self):- tu = TokenUsage(prompt_tokens=10, completion_tokens=20, total_tokens=30, step="search", model="gpt")- assert tu.prompt_tokens == 10- assert tu.completion_tokens == 20- assert tu.total_tokens == 30- assert tu.step == "search"- assert tu.model == "gpt"+ tu = TokenUsage(remaining_tokens=10)+ assert tu.remaining_tokens == 10diff --git a/apps/python-sdk/firecrawl/client.py b/apps/python-sdk/firecrawl/client.pyindex 1e1a8a0b6..fe0476eea 100644--- a/apps/python-sdk/firecrawl/client.py+++ b/apps/python-sdk/firecrawl/client.py@@ -24,6 +24,7 @@ import loggingfrom .v1 import V1FirecrawlApp, AsyncV1FirecrawlAppfrom .v2 import FirecrawlClient as V2FirecrawlClient+from .v2.client_async import AsyncFirecrawlClientlogger = logging.getLogger("firecrawl")@@ -99,11 +100,40 @@ class AsyncV1Proxy:class AsyncV2Proxy:"""Proxy class that forwards method calls to the appropriate version client."""_client: Optional[Any] = None-+def __init__(self, client_instance: Optional[Any] = None):- from .v2.client_async import AsyncFirecrawlClient- self._client = client_instance or AsyncFirecrawlClient()-+ self._client = client_instance++ if client_instance:+ self.scrape = client_instance.scrape+ self.search = client_instance.search+ self.crawl = client_instance.crawl+ self.start_crawl = client_instance.start_crawl+ self.wait_crawl = client_instance.wait_crawl+ self.get_crawl_status = client_instance.get_crawl_status+ self.cancel_crawl = client_instance.cancel_crawl+ self.get_crawl_errors = client_instance.get_crawl_errors+ self.get_active_crawls = client_instance.get_active_crawls+ self.active_crawls = client_instance.active_crawls+ self.crawl_params_preview = client_instance.crawl_params_preview++ self.extract = client_instance.extract+ self.start_extract = client_instance.start_extract+ self.get_extract_status = client_instance.get_extract_status++ self.start_batch_scrape = client_instance.start_batch_scrape+ self.get_batch_scrape_status = client_instance.get_batch_scrape_status+ self.cancel_batch_scrape = client_instance.cancel_batch_scrape+ self.wait_batch_scrape = client_instance.wait_batch_scrape+ self.batch_scrape = client_instance.batch_scrape+ self.get_batch_scrape_errors = client_instance.get_batch_scrape_errors++ self.map = client_instance.map+ self.get_concurrency = client_instance.get_concurrency+ self.get_credit_usage = client_instance.get_credit_usage+ self.get_token_usage = client_instance.get_token_usage+ self.watcher = client_instance.watcher+def __getattr__(self, name):"""Forward attribute access to the underlying client."""if self._client:@@ -170,8 +200,7 @@ class AsyncFirecrawl:# Initialize version-specific clientsself._v1_client = AsyncV1FirecrawlApp(api_key=api_key, api_url=api_url) if AsyncV1FirecrawlApp else None- from .v2.client_async import AsyncFirecrawlClient- self._v2_client = AsyncFirecrawlClient(api_key=api_key, api_url=api_url)+ self._v2_client = AsyncFirecrawlClient(api_key=api_key, api_url=api_url) if AsyncFirecrawlClient else None# Create version-specific proxiesself.v1 = AsyncV1Proxy(self._v1_client) if self._v1_client else Nonediff --git a/apps/python-sdk/firecrawl/v2/methods/aio/search.py b/apps/python-sdk/firecrawl/v2/methods/aio/search.pyindex 104ebcbd7..d43a522db 100644--- a/apps/python-sdk/firecrawl/v2/methods/aio/search.py+++ b/apps/python-sdk/firecrawl/v2/methods/aio/search.py@@ -36,7 +36,7 @@ async def search(client: AsyncHttpClient, request: SearchRequest) -> SearchData:for doc_data in source_documents:if isinstance(doc_data, dict):if request.scrape_options is not None and any(- key in doc_data for key in ['markdown', 'html', 'rawHtml', 'links', 'screenshot', 'changeTracking']+ key in doc_data for key in ['markdown', 'html', 'rawHtml', 'links', 'summary', 'screenshot', 'changeTracking']):normalized = dict(doc_data)if 'rawHtml' in normalized and 'raw_html' not in normalized:diff --git a/apps/python-sdk/firecrawl/v2/methods/aio/usage.py b/apps/python-sdk/firecrawl/v2/methods/aio/usage.pyindex 4ac403691..ceadcb0da 100644--- a/apps/python-sdk/firecrawl/v2/methods/aio/usage.py+++ b/apps/python-sdk/firecrawl/v2/methods/aio/usage.py@@ -18,18 +18,18 @@ async def get_concurrency(client: AsyncHttpClient) -> ConcurrencyCheck:async def get_credit_usage(client: AsyncHttpClient) -> CreditUsage:- resp = await client.get("/v2/credit-usage")+ resp = await client.get("/v2/team/credit-usage")if resp.status_code >= 400:handle_response_error(resp, "get credit usage")body = resp.json()if not body.get("success"):raise Exception(body.get("error", "Unknown error"))data = body.get("data", body)- return CreditUsage(remaining_credits=data.get("remaining_credits"))+ return CreditUsage(remaining_credits=data.get("remainingCredits", data.get("remaining_credits", 0)))async def get_token_usage(client: AsyncHttpClient) -> TokenUsage:- resp = await client.get("/v2/token-usage")+ resp = await client.get("/v2/team/token-usage")if resp.status_code >= 400:handle_response_error(resp, "get token usage")body = resp.json()@@ -37,10 +37,6 @@ async def get_token_usage(client: AsyncHttpClient) -> TokenUsage:raise Exception(body.get("error", "Unknown error"))data = body.get("data", body)return TokenUsage(- prompt_tokens=data.get("promptTokens", data.get("prompt_tokens", 0)),- completion_tokens=data.get("completionTokens", data.get("completion_tokens", 0)),- total_tokens=data.get("totalTokens", data.get("total_tokens", 0)),- step=data.get("step"),- model=data.get("model"),+ remaining_tokens=data.get("remainingTokens", 0))diff --git a/apps/python-sdk/firecrawl/v2/methods/search.py b/apps/python-sdk/firecrawl/v2/methods/search.pyindex 1495b0f34..13e5fc3f4 100644--- a/apps/python-sdk/firecrawl/v2/methods/search.py+++ b/apps/python-sdk/firecrawl/v2/methods/search.py@@ -48,7 +48,7 @@ def search(if isinstance(doc_data, dict):# If page scraping options were provided, API returns full Document objectsif request.scrape_options is not None and any(- key in doc_data for key in ['markdown', 'html', 'rawHtml', 'links', 'screenshot', 'changeTracking']+ key in doc_data for key in ['markdown', 'html', 'rawHtml', 'links', 'summary', 'screenshot', 'changeTracking']):# Normalize keys for Document (no Pydantic aliases)normalized = dict(doc_data)diff --git a/apps/python-sdk/firecrawl/v2/methods/usage.py b/apps/python-sdk/firecrawl/v2/methods/usage.pyindex a210d5979..c9888fe5c 100644--- a/apps/python-sdk/firecrawl/v2/methods/usage.py+++ b/apps/python-sdk/firecrawl/v2/methods/usage.py@@ -24,7 +24,7 @@ def get_credit_usage(client: HttpClient) -> CreditUsage:if not body.get("success"):raise Exception(body.get("error", "Unknown error"))data = body.get("data", body)- return CreditUsage(remaining_credits=data.get("remaining_credits"))+ return CreditUsage(remaining_credits=data.get("remainingCredits", data.get("remaining_credits", 0)))def get_token_usage(client: HttpClient) -> TokenUsage:@@ -36,10 +36,6 @@ def get_token_usage(client: HttpClient) -> TokenUsage:raise Exception(body.get("error", "Unknown error"))data = body.get("data", body)return TokenUsage(- prompt_tokens=data.get("promptTokens", data.get("prompt_tokens", 0)),- completion_tokens=data.get("completionTokens", data.get("completion_tokens", 0)),- total_tokens=data.get("totalTokens", data.get("total_tokens", 0)),- step=data.get("step"),- model=data.get("model"),+ remaining_tokens=data.get("remainingTokens", 0))diff --git a/apps/python-sdk/firecrawl/v2/types.py b/apps/python-sdk/firecrawl/v2/types.pyindex bbe5b40d0..42d7f22c0 100644--- a/apps/python-sdk/firecrawl/v2/types.py+++ b/apps/python-sdk/firecrawl/v2/types.py@@ -77,6 +77,7 @@ class Document(BaseModel):html: Optional[str] = Noneraw_html: Optional[str] = Nonejson: Optional[Any] = None+ summary: Optional[str] = Nonemetadata: Optional[DocumentMetadata] = Nonelinks: Optional[List[str]] = Nonescreenshot: Optional[str] = None@@ -151,6 +152,7 @@ class ScrapeFormats(BaseModel):markdown: bool = Truehtml: bool = Falseraw_html: bool = False+ summary: bool = Falselinks: bool = Falsescreenshot: bool = Falsechange_tracking: bool = False@@ -365,11 +367,7 @@ class CreditUsage(BaseModel):class TokenUsage(BaseModel):"""Recent token usage metrics (if available)."""- prompt_tokens: int- completion_tokens: int- total_tokens: int- step: Optional[str] = None- model: Optional[str] = None+ remaining_tokens: int# Action typesclass WaitAction(BaseModel):diff --git a/apps/python-sdk/firecrawl/v2/utils/validation.py b/apps/python-sdk/firecrawl/v2/utils/validation.pyindex 655048104..277d1e3cb 100644--- a/apps/python-sdk/firecrawl/v2/utils/validation.py+++ b/apps/python-sdk/firecrawl/v2/utils/validation.py@@ -191,6 +191,8 @@ def prepare_scrape_options(options: Optional[ScrapeOptions]) -> Optional[Dict[stconverted_formats.append("html")if original_formats.raw_html:converted_formats.append("rawHtml")+ if original_formats.summary:+ converted_formats.append("summary")if original_formats.links:converted_formats.append("links")if original_formats.screenshot: