Skip to content

About

Ruby client on net/http for live web search, page text as Markdown, Google Custom Search, Bing v7, Tavily and Exa drop-ins and ready data lists. No gems.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ruby client for live web search, page extraction, Google CSE, Tavily, Exa and ready data lists

One Ruby file on the standard library (net/http and json, no gems) for SpecStream, the live web data engine. One key answers SpecStream's own Search and Extract APIs and the drop-in routes that speak Google Custom Search, Bing Web Search v7, Tavily and Exa in their own request and reply shapes. Ready data lists are searched and sampled without a key.

Method Route on https://api.specstream.ai Key goes Reply
web_search GET /v1/web-search Authorization: Bearer "sources"
extract POST /v1/extract Authorization: Bearer page text as Markdown
google_cse GET /customsearch/v1 key= in the address Google's "items"
bing GET /v7.0/search Ocp-Apim-Subscription-Key Bing's "webPages"
tavily POST /tavily/search Authorization: Bearer Tavily's "results"
exa POST /exa/search x-api-key Exa's "results"
find_lists, describe, sample /v1/data/lists/search, /v1/data/lists, /v1/data/lists/sample no key free

Every search runs on the fast tier: $1 per 1,000 searches, 937 ms median over 6,548 live calls in the 7 days to December 1, 2026. Google ends the Custom Search JSON API on January 1, 2027; the same request answers here.

Run

git clone https://github.com/specstream/ruby-specstream-search
cd ruby-specstream-search
ruby bin/specstream check                    # live, no key, nothing charged
ruby bin/specstream lists "nursing homes"    # ready data lists, no key
ruby bin/specstream sample /data/hospitals   # the 10 newest rows of a list, no key
API reachable: 70 drop-in APIs on 78 routes at https://api.specstream.ai
  Google Custom Search JSON API    replaces https://www.googleapis.com
  Tavily                           replaces https://api.tavily.com
  Exa                              replaces https://api.exa.ai
  Bing Web Search API v7           replaces https://api.bing.microsoft.com/v7.0/search
  ready list:     14686 rows  /data/nursing-homes
  ready list:     10885 rows  /data/nursing-homes/ownership/for-profit
  ready list:      7504 rows  /data/nursing-homes/harm-citations

Get a key under Agents & API at specstream.ai/workspace. A new account gets $2 of credit with no card, which is 2,000 fast searches.

export SPECSTREAM_API_KEY=your_key
ruby bin/specstream search "Rails 8 release notes"
ruby bin/specstream extract https://rubyonrails.org/
ruby bin/specstream cse "best crm for startups"
ruby bin/specstream tavily "best crm for startups"
ruby bin/specstream exa "best crm for startups"

In your app

Copy lib/specstream.rb into your project, or require it from here:

require_relative "lib/specstream"

client = SpecStream::Client.new # reads SPECSTREAM_API_KEY

client.web_search("latest PostgreSQL release notes")["sources"].each do |s|
  puts "#{s['title']} #{s['url']}"
end
page = client.extract(["https://www.postgresql.org/docs/release/"]).first
puts page["text"] # Markdown, also from PDFs and Office files

client.find_lists("nursing homes", limit: 5)   # no key
client.sample("/data/nursing-homes")           # no key, the 10 newest rows

A reply outside 2xx raises SpecStream::Error with status and body, the body in that route's own error shape, so code written for Bing or Tavily errors keeps reading them.

Code that calls Google Custom Search today

- uri = URI("https://www.googleapis.com/customsearch/v1?key=#{google_key}&cx=#{cx}&q=#{q}")
+ uri = URI("https://api.specstream.ai/customsearch/v1?key=#{specstream_key}&q=#{q}")

The reply keeps items[].title, link, displayLink and snippet.

Prices

Price
Free credit on sign-up $2, which is 2,000 fast searches, no card
Fast search, every drop-in route $1 per 1,000
Extract API, page text as Markdown $0.80 per 1,000 pages
Ready list rows by API 5¢ a row the first time, free after
Monthly Pro Pass $49 a month: 5,000 ready list rows a month and $49 of API credit

Links

License

MIT

About

Ruby client on net/http for live web search, page text as Markdown, Google Custom Search, Bing v7, Tavily and Exa drop-ins and ready data lists. No gems.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages