firecrawl-sdk 1.17.6 → 1.18.0
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 +4 -4
- data/README.md +19 -0
- data/lib/firecrawl/client.rb +29 -4
- data/lib/firecrawl/models/developer_search_options.rb +37 -0
- data/lib/firecrawl/models/developer_search_response.rb +76 -0
- data/lib/firecrawl/models/product_profile.rb +8 -4
- data/lib/firecrawl/version.rb +1 -1
- data/lib/firecrawl.rb +2 -0
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6127c4b3f294f6ed277ec8bb3ff5e6509e77433574f464059e2ee132a538d8a7
|
|
4
|
+
data.tar.gz: 381b43134f7413951f904b74898c1ecff899c1b1e3aa110ab3a127dc818fec15
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 240a043cdb953f513bebfc8081a7c3174a5057a94f1f5d1d579b0a988ed358701cc905a04d218f6d05c7ba57e6ac9d4a6b459f4348dc6d3916d7de9334f0ba09
|
|
7
|
+
data.tar.gz: fb24f0b5f108a67de0fe602d2c852f0b2933ec75a8345badf4498b88a658c670ffc0b8714a5fb6e885da502dcf1d4231f4b0a1f93c4090793c6ae95a88432a59
|
data/README.md
CHANGED
|
@@ -193,6 +193,25 @@ results = client.search("latest news",
|
|
|
193
193
|
Firecrawl::Models::SearchOptions.new(limit: 5, location: "US"))
|
|
194
194
|
```
|
|
195
195
|
|
|
196
|
+
### Developer Search
|
|
197
|
+
|
|
198
|
+
Search public repositories, GitHub issues, merged pull requests, READMEs and code documentation. It replaces the research index GitHub search, which was removed after 2026-11-03.
|
|
199
|
+
|
|
200
|
+
```ruby
|
|
201
|
+
response = client.developer_search(
|
|
202
|
+
"retry an http request with exponential backoff",
|
|
203
|
+
Firecrawl::Models::DeveloperSearchOptions.new(
|
|
204
|
+
k: 5,
|
|
205
|
+
types: ["issue", "pull_request"],
|
|
206
|
+
repos: ["square/okhttp"]
|
|
207
|
+
)
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
response.results.each do |result|
|
|
211
|
+
puts "#{result.title} #{result.url}"
|
|
212
|
+
end
|
|
213
|
+
```
|
|
214
|
+
|
|
196
215
|
### Agent
|
|
197
216
|
|
|
198
217
|
```ruby
|
data/lib/firecrawl/client.rb
CHANGED
|
@@ -131,12 +131,21 @@ module Firecrawl
|
|
|
131
131
|
@http.get("#{path}#{query(options.merge("intent" => intent, "origin" => "ruby-sdk@#{Firecrawl::VERSION}"))}")
|
|
132
132
|
end
|
|
133
133
|
|
|
134
|
+
# Look up a protein's UniProt location, function and GO cellular-component terms.
|
|
135
|
+
# The response's "notice" is the UniProt credit and license. Show it with the results.
|
|
136
|
+
#
|
|
137
|
+
# @param protein [String] UniProt accession, entry name, gene symbol or protein name
|
|
138
|
+
# @param options [Hash] optional query parameters
|
|
139
|
+
# @return [Hash]
|
|
140
|
+
def lookup_protein(protein, options = {})
|
|
141
|
+
raise ArgumentError, "Protein is required" if protein.nil?
|
|
142
|
+
@http.get("/v2/search/research/proteins#{query(options.merge("protein" => protein, "origin" => "ruby-sdk@#{Firecrawl::VERSION}"))}")
|
|
143
|
+
end
|
|
144
|
+
|
|
134
145
|
# Search GitHub research content.
|
|
135
146
|
#
|
|
136
|
-
# @deprecated
|
|
137
|
-
#
|
|
138
|
-
# call it directly. It does not carry over the score breakdown or the
|
|
139
|
-
# web fallback results.
|
|
147
|
+
# @deprecated The research index GitHub search endpoint was removed after
|
|
148
|
+
# 2026-11-03. Use {#developer_search} instead.
|
|
140
149
|
# @param query_text [String] GitHub query
|
|
141
150
|
# @param options [Hash] optional query parameters
|
|
142
151
|
# @return [Hash]
|
|
@@ -144,6 +153,22 @@ module Firecrawl
|
|
|
144
153
|
@http.get("/v2/search/research/github#{query(options.merge("query" => query_text, "origin" => "ruby-sdk@#{Firecrawl::VERSION}"))}")
|
|
145
154
|
end
|
|
146
155
|
|
|
156
|
+
# Searches the developer index: public repositories, GitHub issues, merged
|
|
157
|
+
# pull requests, READMEs and code documentation.
|
|
158
|
+
#
|
|
159
|
+
# @param query [String] the search query
|
|
160
|
+
# @param options [Models::DeveloperSearchOptions, nil] developer search filters
|
|
161
|
+
# @return [Models::DeveloperSearchResponse]
|
|
162
|
+
# @raise [ArgumentError] if the query is blank
|
|
163
|
+
def developer_search(query, options = nil)
|
|
164
|
+
raise ArgumentError, "Query is required" if query.nil? || query.to_s.strip.empty?
|
|
165
|
+
|
|
166
|
+
body = { "query" => query }
|
|
167
|
+
body.merge!(options.to_h) if options
|
|
168
|
+
body["origin"] ||= "ruby-sdk@#{Firecrawl::VERSION}"
|
|
169
|
+
Models::DeveloperSearchResponse.new(@http.post("/v2/search/developer", body))
|
|
170
|
+
end
|
|
171
|
+
|
|
147
172
|
# Interacts with the scrape-bound browser session for a scrape job.
|
|
148
173
|
#
|
|
149
174
|
# @param job_id [String] the scrape job ID
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Firecrawl
|
|
4
|
+
module Models
|
|
5
|
+
# Options for a developer search request. Unset fields are omitted.
|
|
6
|
+
#
|
|
7
|
+
# - k: total ranked results, 1 to 100 (default 10)
|
|
8
|
+
# - passages: passages per result, 1 to 5 (default 1)
|
|
9
|
+
# - types: result kinds, any of "doc", "issue", "pull_request", "readme"
|
|
10
|
+
# - repos: GitHub owner/name filters, at most 20
|
|
11
|
+
# - sources: developer documentation source IDs, at most 20
|
|
12
|
+
# - language: one case-insensitive GitHub Linguist primary language
|
|
13
|
+
# - topic: repository topics that must all match, at most 8
|
|
14
|
+
# - license: one case-insensitive SPDX repository license identifier
|
|
15
|
+
# - min_stars, max_stars, archived, fork: repository filters
|
|
16
|
+
# - skills: "only" returns packaged agent-skill evidence only
|
|
17
|
+
class DeveloperSearchOptions
|
|
18
|
+
FIELDS = %i[
|
|
19
|
+
k passages types repos sources language topic license
|
|
20
|
+
min_stars max_stars archived fork skills
|
|
21
|
+
].freeze
|
|
22
|
+
|
|
23
|
+
attr_reader(*FIELDS)
|
|
24
|
+
|
|
25
|
+
def initialize(**kwargs)
|
|
26
|
+
unknown = kwargs.keys - FIELDS
|
|
27
|
+
raise ArgumentError, "unknown developer search option(s): #{unknown.join(", ")}" unless unknown.empty?
|
|
28
|
+
|
|
29
|
+
FIELDS.each { |f| instance_variable_set(:"@#{f}", kwargs[f]) }
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def to_h
|
|
33
|
+
FIELDS.to_h { |f| [f.to_s, public_send(f)] }.compact
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Firecrawl
|
|
4
|
+
module Models
|
|
5
|
+
# One matched passage of a developer search result.
|
|
6
|
+
class DeveloperSearchPassage
|
|
7
|
+
attr_reader :text, :citation_url
|
|
8
|
+
|
|
9
|
+
def initialize(data)
|
|
10
|
+
@text = data["text"]
|
|
11
|
+
@citation_url = data["citation_url"]
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# One ranked developer search result. `license` is either an SPDX string or
|
|
16
|
+
# a disclosure object (Hash), so it is kept as returned.
|
|
17
|
+
class DeveloperSearchResult
|
|
18
|
+
attr_reader :id, :url, :title, :passages, :license
|
|
19
|
+
|
|
20
|
+
def initialize(data)
|
|
21
|
+
@id = data["id"]
|
|
22
|
+
@url = data["url"]
|
|
23
|
+
@title = data["title"]
|
|
24
|
+
@passages = (data["passages"] || []).map { |p| DeveloperSearchPassage.new(p) }
|
|
25
|
+
@license = data["license"]
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Whether a requested repository is indexed, and which result types it has.
|
|
30
|
+
class DeveloperSearchRepoStatus
|
|
31
|
+
attr_reader :repo, :indexed, :types
|
|
32
|
+
|
|
33
|
+
def initialize(data)
|
|
34
|
+
@repo = data["repo"]
|
|
35
|
+
@indexed = data["indexed"] == true
|
|
36
|
+
@types = data["types"] || {}
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def indexed?
|
|
40
|
+
indexed
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Whether a requested documentation source is indexed.
|
|
45
|
+
class DeveloperSearchSourceStatus
|
|
46
|
+
attr_reader :source, :indexed
|
|
47
|
+
|
|
48
|
+
def initialize(data)
|
|
49
|
+
@source = data["source"]
|
|
50
|
+
@indexed = data["indexed"] == true
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def indexed?
|
|
54
|
+
indexed
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Response from a developer search. `repos` and `sources` are present only
|
|
59
|
+
# when those filters were requested.
|
|
60
|
+
class DeveloperSearchResponse
|
|
61
|
+
attr_reader :success, :partial, :results, :repos, :sources
|
|
62
|
+
|
|
63
|
+
def initialize(data)
|
|
64
|
+
@success = data["success"] == true
|
|
65
|
+
@partial = data["partial"] == true
|
|
66
|
+
@results = (data["results"] || []).map { |r| DeveloperSearchResult.new(r) }
|
|
67
|
+
@repos = data["repos"]&.map { |r| DeveloperSearchRepoStatus.new(r) }
|
|
68
|
+
@sources = data["sources"]&.map { |s| DeveloperSearchSourceStatus.new(s) }
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def to_s
|
|
72
|
+
"DeveloperSearchResponse{results=#{results.size}}"
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
@@ -26,13 +26,14 @@ module Firecrawl
|
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
# Stock availability information for a variant. Always present
|
|
29
|
+
# Stock availability information for a variant. Always present;
|
|
30
|
+
# in_stock is nil when the page does not state whether it is in stock.
|
|
30
31
|
class Availability
|
|
31
32
|
attr_reader :in_stock, :text
|
|
32
33
|
|
|
33
34
|
def initialize(data)
|
|
34
35
|
data ||= {}
|
|
35
|
-
@in_stock = data["inStock"]
|
|
36
|
+
@in_stock = data["inStock"]
|
|
36
37
|
@text = data["text"]
|
|
37
38
|
end
|
|
38
39
|
end
|
|
@@ -49,12 +50,15 @@ module Firecrawl
|
|
|
49
50
|
# A purchasable variant of a product. Pricing, availability, and images
|
|
50
51
|
# live here rather than on the top-level product.
|
|
51
52
|
class Variant
|
|
52
|
-
attr_reader :id, :sku, :
|
|
53
|
-
:availability, :images
|
|
53
|
+
attr_reader :id, :sku, :gtin, :mpn, :condition, :title, :values,
|
|
54
|
+
:price, :sale, :availability, :images
|
|
54
55
|
|
|
55
56
|
def initialize(data)
|
|
56
57
|
@id = data["id"]
|
|
57
58
|
@sku = data["sku"]
|
|
59
|
+
@gtin = data["gtin"]
|
|
60
|
+
@mpn = data["mpn"]
|
|
61
|
+
@condition = data["condition"]
|
|
58
62
|
@title = data["title"]
|
|
59
63
|
@values = data["values"]
|
|
60
64
|
@price = data["price"] && Price.new(data["price"])
|
data/lib/firecrawl/version.rb
CHANGED
data/lib/firecrawl.rb
CHANGED
|
@@ -20,6 +20,8 @@ require_relative "firecrawl/models/map_options"
|
|
|
20
20
|
require_relative "firecrawl/models/map_data"
|
|
21
21
|
require_relative "firecrawl/models/search_options"
|
|
22
22
|
require_relative "firecrawl/models/search_data"
|
|
23
|
+
require_relative "firecrawl/models/developer_search_options"
|
|
24
|
+
require_relative "firecrawl/models/developer_search_response"
|
|
23
25
|
require_relative "firecrawl/models/parse_file"
|
|
24
26
|
require_relative "firecrawl/models/parse_options"
|
|
25
27
|
require_relative "firecrawl/models/parse_format"
|
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.
|
|
4
|
+
version: 1.18.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Firecrawl
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-11-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: 'A type-safe Ruby client for the Firecrawl v2 API: search, scrape, parse,
|
|
14
14
|
crawl, map, and interact with the web, run batch scrapes, and run Agent and Monitor
|
|
@@ -43,6 +43,8 @@ files:
|
|
|
43
43
|
- lib/firecrawl/models/crawl_options.rb
|
|
44
44
|
- lib/firecrawl/models/crawl_response.rb
|
|
45
45
|
- lib/firecrawl/models/credit_usage.rb
|
|
46
|
+
- lib/firecrawl/models/developer_search_options.rb
|
|
47
|
+
- lib/firecrawl/models/developer_search_response.rb
|
|
46
48
|
- lib/firecrawl/models/document.rb
|
|
47
49
|
- lib/firecrawl/models/map_data.rb
|
|
48
50
|
- lib/firecrawl/models/map_options.rb
|