firecrawl-sdk 1.17.3 → 1.17.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 02dbea25069649d09dd507af8b1e2fed0010c8c5d454ee04117261d3e8a2dbc0
4
- data.tar.gz: c0b3d3596a2f68d8d26c976f707db9cbc407da5eda3f3d2b3547ed1affcace6f
3
+ metadata.gz: 53e3ea073fe92f4844413816b5ead8af79b4592e0739fbeb1e29830cb46171b4
4
+ data.tar.gz: d5618aa818aee77b578d67cad9e3efdf4e9c0fa8e14cac20c336be9dbf726f09
5
5
  SHA512:
6
- metadata.gz: c1875f25b8ccebed6d9af7f31a0941f777a9c46ff448cedb428c8440a26b8e25927683d7bd86ad0ad35d81c3a762121c8e7051f83f8bdcf1e85749aa7667650d
7
- data.tar.gz: 40fef9f8bb7032e9fb3bc55695af46e716b243c885faf7088acd6d6a14834482ba1b070e9f28409d4b0925bc2a7511d34ce3c1341a746aa98467d352c5409de2
6
+ metadata.gz: 57e6f05f940ac44ccbe1ba89ca094a5901dc52933ac101faf7ff7c6b554517e520afe9d8cfdca5ce730df867a2c03e2427f3e92201a10e5935d5036f01f3934e
7
+ data.tar.gz: 63ee5fd6751e00f6fc3006a778c9b0664f8118142192d64a427c2a0509c19f4c1090375095f610c79d1fcea56210448779353e708648c9641dec6bef9f9ce3c0
@@ -81,6 +81,10 @@ module Firecrawl
81
81
  body.merge!(options.to_h) if options
82
82
  body["origin"] ||= "ruby-sdk@#{Firecrawl::VERSION}"
83
83
  raw = @http.post("/v2/scrape", body)
84
+ # Some scrape failures (e.g. SCRAPE_DNS_RESOLUTION_ERROR) arrive as HTTP 200 with success: false.
85
+ if raw["success"] == false
86
+ raise FirecrawlError.new(raw["error"] || "Scrape failed", status_code: 200, error_code: raw["code"], details: raw["details"])
87
+ end
84
88
  data = raw["data"] || raw
85
89
  Models::Document.new(data)
86
90
  end
@@ -7,6 +7,11 @@ module Firecrawl
7
7
  # Parse does not support browser-rendering features (actions, waitFor,
8
8
  # location, mobile) nor screenshot/branding/product/menu/audio/video/changeTracking formats. The
9
9
  # proxy field only accepts "auto" or "basic".
10
+ #
11
+ # check_prompt_injection scans the parsed content for prompt injection
12
+ # before LLM-backed formats run. A detection fails the parse with
13
+ # SCRAPE_PROMPT_INJECTION_DETECTED. Adds 4 credits when the check scans
14
+ # the whole content.
10
15
  class ParseOptions
11
16
  UNSUPPORTED_FORMATS = %w[changeTracking screenshot screenshot@fullPage branding product menu audio video].freeze
12
17
 
@@ -14,6 +19,7 @@ module Firecrawl
14
19
  formats headers include_tags exclude_tags only_main_content
15
20
  timeout parsers skip_tls_verification remove_base64_images
16
21
  block_ads proxy integration redact_pii json_options audit_metadata
22
+ check_prompt_injection
17
23
  ].freeze
18
24
 
19
25
  attr_reader(*FIELDS)
@@ -42,6 +48,7 @@ module Firecrawl
42
48
  "proxy" => proxy,
43
49
  "integration" => integration,
44
50
  "redactPII" => redact_pii,
51
+ "checkPromptInjection" => check_prompt_injection,
45
52
  "jsonOptions" => json_options.is_a?(Hash) ? json_options : json_options&.to_h,
46
53
  "auditMetadata" => audit_metadata&.to_h,
47
54
  }.compact
@@ -43,6 +43,9 @@ module Firecrawl
43
43
  end
44
44
 
45
45
  # JSON format for extracting structured data from page content using a schema.
46
+ #
47
+ # check_prompt_injection is deprecated: use ScrapeOptions#check_prompt_injection
48
+ # or ParseOptions#check_prompt_injection.
46
49
  class JsonFormat
47
50
  attr_reader :schema, :prompt, :check_prompt_injection
48
51
 
@@ -3,12 +3,18 @@
3
3
  module Firecrawl
4
4
  module Models
5
5
  # Options for scraping a single URL.
6
+ #
7
+ # check_prompt_injection scans the page content for prompt injection with
8
+ # any format except rawBase64, before LLM-backed formats run. A detection
9
+ # fails the scrape with SCRAPE_PROMPT_INJECTION_DETECTED. Adds 4 credits
10
+ # when the check scans the whole page.
6
11
  class ScrapeOptions
7
12
  FIELDS = %i[
8
13
  formats headers include_tags exclude_tags only_main_content
9
14
  timeout wait_for mobile parsers actions location
10
15
  skip_tls_verification remove_base64_images block_ads proxy
11
- max_age store_in_cache lockdown redact_pii integration audit_metadata
16
+ max_age store_in_cache lockdown check_prompt_injection redact_pii
17
+ integration audit_metadata
12
18
  ].freeze
13
19
 
14
20
  attr_reader(*FIELDS)
@@ -41,6 +47,7 @@ module Firecrawl
41
47
  "maxAge" => max_age,
42
48
  "storeInCache" => store_in_cache,
43
49
  "lockdown" => lockdown,
50
+ "checkPromptInjection" => check_prompt_injection,
44
51
  "redactPII" => redact_pii,
45
52
  "integration" => integration,
46
53
  "auditMetadata" => audit_metadata&.to_h,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Firecrawl
4
- VERSION = "1.17.3"
4
+ VERSION = "1.17.5"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: firecrawl-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.17.3
4
+ version: 1.17.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Firecrawl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-06 00:00:00.000000000 Z
11
+ date: 2026-10-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A type-safe Ruby client for the Firecrawl v2 API. Supports scraping,
14
14
  crawling, batch scraping, URL mapping, web search, and AI agent operations.