firecrawl-sdk 1.8.1 → 1.9.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/lib/firecrawl/client.rb +66 -3
- data/lib/firecrawl/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 027be403af5ba321ba2d4dbeaa774433666ece0a98cca4ac03ffbce52ac6cae2
|
|
4
|
+
data.tar.gz: d0ee19ba03f949234d00482c6e0c451986de84c4e4dfde7860c970845a23e3b4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fb9869b378f9d8252cd45ad2b5be1d7f5e9c30f3c67d4752177e3d205a689b75f3da972f389e5d70260bbde576e1677068c4b538ea82c92c25643a239debd879
|
|
7
|
+
data.tar.gz: f8ad0a882856666ef4662d6356608759513305babc5392100c1cba5ddcaffb89392c67c447aa181cb3ab97230cd0bec4f7f957c11e4585068ef58a2eadcbacda
|
data/lib/firecrawl/client.rb
CHANGED
|
@@ -85,6 +85,57 @@ module Firecrawl
|
|
|
85
85
|
Models::Document.new(data)
|
|
86
86
|
end
|
|
87
87
|
|
|
88
|
+
# Search research papers.
|
|
89
|
+
#
|
|
90
|
+
# @param query [String] research query
|
|
91
|
+
# @param options [Hash] optional query parameters
|
|
92
|
+
# @return [Hash]
|
|
93
|
+
def search_papers(query, options = {})
|
|
94
|
+
@http.get("/v2/search/research/papers#{query(options.merge("query" => query, "origin" => "ruby-sdk@#{Firecrawl::VERSION}"))}")
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Inspect paper metadata.
|
|
98
|
+
#
|
|
99
|
+
# @param paper_id [String] paper identifier
|
|
100
|
+
# @return [Hash]
|
|
101
|
+
def inspect_paper(paper_id)
|
|
102
|
+
raise ArgumentError, "Paper ID is required" if paper_id.nil?
|
|
103
|
+
@http.get("/v2/search/research/papers/#{URI.encode_www_form_component(paper_id)}")
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Read a paper with query-guided passages.
|
|
107
|
+
#
|
|
108
|
+
# @param paper_id [String] paper identifier
|
|
109
|
+
# @param query_text [String] passage query
|
|
110
|
+
# @param options [Hash] optional query parameters
|
|
111
|
+
# @return [Hash]
|
|
112
|
+
def read_paper(paper_id, query_text, options = {})
|
|
113
|
+
raise ArgumentError, "Paper ID is required" if paper_id.nil?
|
|
114
|
+
path = "/v2/search/research/papers/#{URI.encode_www_form_component(paper_id)}"
|
|
115
|
+
@http.get("#{path}#{query(options.merge("query" => query_text, "origin" => "ruby-sdk@#{Firecrawl::VERSION}"))}")
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Find papers related to a paper.
|
|
119
|
+
#
|
|
120
|
+
# @param paper_id [String] paper identifier
|
|
121
|
+
# @param intent [String] relatedness intent
|
|
122
|
+
# @param options [Hash] optional query parameters
|
|
123
|
+
# @return [Hash]
|
|
124
|
+
def related_papers(paper_id, intent, options = {})
|
|
125
|
+
raise ArgumentError, "Paper ID is required" if paper_id.nil?
|
|
126
|
+
path = "/v2/search/research/papers/#{URI.encode_www_form_component(paper_id)}/similar"
|
|
127
|
+
@http.get("#{path}#{query(options.merge("intent" => intent, "origin" => "ruby-sdk@#{Firecrawl::VERSION}"))}")
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Search GitHub research content.
|
|
131
|
+
#
|
|
132
|
+
# @param query_text [String] GitHub query
|
|
133
|
+
# @param options [Hash] optional query parameters
|
|
134
|
+
# @return [Hash]
|
|
135
|
+
def search_github(query_text, options = {})
|
|
136
|
+
@http.get("/v2/search/research/github#{query(options.merge("query" => query_text, "origin" => "ruby-sdk@#{Firecrawl::VERSION}"))}")
|
|
137
|
+
end
|
|
138
|
+
|
|
88
139
|
# Interacts with the scrape-bound browser session for a scrape job.
|
|
89
140
|
#
|
|
90
141
|
# @param job_id [String] the scrape job ID
|
|
@@ -465,9 +516,21 @@ module Firecrawl
|
|
|
465
516
|
|
|
466
517
|
private
|
|
467
518
|
|
|
468
|
-
def query(**
|
|
469
|
-
|
|
470
|
-
|
|
519
|
+
def query(params = nil, **kwargs)
|
|
520
|
+
params = (params || {}).merge(kwargs)
|
|
521
|
+
pairs = []
|
|
522
|
+
params.each do |key, value|
|
|
523
|
+
next if value.nil? || value == ""
|
|
524
|
+
|
|
525
|
+
values = value.is_a?(Array) ? value : [value]
|
|
526
|
+
values.each do |item|
|
|
527
|
+
next if item.nil? || item == ""
|
|
528
|
+
|
|
529
|
+
string_value = item == true ? "true" : item == false ? "false" : item.to_s
|
|
530
|
+
pairs << [key.to_s, string_value]
|
|
531
|
+
end
|
|
532
|
+
end
|
|
533
|
+
pairs.empty? ? "" : "?#{URI.encode_www_form(pairs)}"
|
|
471
534
|
end
|
|
472
535
|
|
|
473
536
|
def poll_crawl(job_id, poll_interval, timeout)
|
data/lib/firecrawl/version.rb
CHANGED
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.9.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-06-
|
|
11
|
+
date: 2026-06-16 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.
|