LogoLogo
OverviewRelease NotesDataPipelineFAQs
Ruby
Ruby
  • Make Requests with ScraperAPI in Ruby
    • Use ScraperAPI Endpoint in Ruby
    • Use ScraperAPI Proxy Port in Ruby
    • Use ScraperAPI SDK in Ruby
    • Make Async Requests with ScraperAPI in Ruby
      • How to Use ScraperAPI Async Web Scraping in Ruby
      • Use Async ScraperAPI Callbacks in Ruby
      • Configure ScraperAPI Parameters in Ruby
      • Request Async Batch Scraping with ScraperAPI in Ruby
      • Decode Base64 Async Responses in Ruby
    • ScraperAPI Structured Data Collection in Ruby
      • Amazon Product Page API: Structured Data in Ruby
      • Amazon Search API: Structured Data in Ruby
      • Amazon Offers API: Structured Data in Ruby
      • Amazon Reviews API: Structured Data in Ruby
      • Ebay Product Page API: Structured Data in Ruby
      • Ebay Search API: Structured Data in Ruby
      • Google SERP API: Structured Data in Ruby
      • Google News API: Structured Data in Ruby
      • Google Jobs API: Structured Data in Ruby
      • Google Shopping API: Structured Data in Ruby
      • Google Maps Search API: Structured Data in Ruby
      • Redfin Agent Details API: Structured Data in Ruby
      • Redfin 'For Rent' Listings API: Structured Data in Ruby
      • Redfin 'For Sale' Listings API: Structured Data in Ruby
      • Redfin Listing Search API: Structured Data in Ruby
      • Walmart Search API: Structured Data in Ruby
      • Walmart Category API: Structured Data in Ruby
      • Walmart Product API: Structured Data in Ruby
      • Walmart Reviews API: Structured Data in Ruby
    • ScraperAPI Async Structured Data Collection in Ruby
      • Amazon Product Page API: Async Structured Data in Ruby
      • Amazon Search API: Async Structured Data in Ruby
      • Amazon Offers API: Async Structured Data in Ruby
      • Amazon Reviews API: Async Structured Data in Ruby
      • Ebay Product Page API: Async Structured Data in Ruby
      • Ebay Search API: Async Structured Data in Ruby
      • Google SERP API: Async Structured Data in Ruby
      • Google News API: Async Structured Data in Ruby
      • Google Jobs API: Async Structured Data in Ruby
      • Google Shopping API: Async Structured Data in Ruby
      • Google Maps Search API: Async Structured Data in Ruby
      • Redfin Agent Details API: Async Structured Data in Ruby
      • Redfin 'For Rent' Listings API: Async Structured Data in Ruby
      • Redfin 'For Sale' Listings API: Async Structured Data in Ruby
      • Redfin Listing Search API: Async Structured Data in Ruby
      • Walmart Search API: Async Structured Data in Ruby
      • Walmart Category API: Async Structured Data in Ruby
      • Walmart Product API: Async Structured Data in Ruby
      • Walmart Reviews API: Async Structured Data in Ruby
    • Making POST/PUT Requests with ScraperAPI in Ruby
    • Customizing ScraperAPI Requests in Ruby
      • Customize Amazon Requests by ZIP Code via ScraperAPI in Ruby
      • Customize Cached Results via ScraperAPI in Ruby
      • Customize Control Costs with ScraperAPI Parameter in Ruby
      • Send Custom Headers with ScraperAPI in Ruby
      • Customize Device Type with ScraperAPI in Ruby
      • Customize Geotargeted Content Scrape via ScraperAPI in Ruby
      • Customize Premium Geotargeted Scrape via ScraperAPI in Ruby
      • Customize Header Parameter with ScraperAPI in Ruby
      • Customize Premium Residential/Mobile Proxies in Ruby
      • Customize JavaScript-Rendered Pages via ScraperAPI in Ruby
        • Use Render Instruction Set to Scrape Dynamic Pages in Ruby
        • Customize Taking a Website Screenshots via ScraperAPI in Ruby
      • Customize Scrape Session-Based Proxies via ScraperAPI in Ruby
  • Handle and Process Responses via ScraperAPI in Ruby
    • Use API Status Codes to Retry Failed Requests in Ruby
    • Customize Output Formats via ScraperAPI Parameters in Ruby
      • Request JSON Response via Autoparse Parameter in Ruby
      • Request LLM Output Formats with ScraperAPI in Ruby
    • Request Response Encoding and Content-Type via ScraperAPI in Ruby
  • Dashboard & Billing
    • API Key
    • Credit Usage
    • Delete Account
    • Invoice History
    • Billing Email
    • Billing Address
    • VAT Number
    • Payment Method
    • Cancel Subscription
  • Credits and Requests
  • Monitor Your ScraperAPI Account Information in Ruby
  • Documentation Overview
Powered by GitBook

Quick links

  • Homepage
  • Dashboard
  • Pricing
  • Contact Sales

Resources

  • Developer Guides
  • Blog
  • Contact Support
  • Learning Hub
On this page

Was this helpful?

  1. Handle and Process Responses via ScraperAPI in Ruby
  2. Customize Output Formats via ScraperAPI Parameters in Ruby

Request LLM Output Formats with ScraperAPI in Ruby

Learn how to use ScraperAPI’s output parameter in Ruby to generate clean, structured text and markdown responses ideal for training large language models.

To properly train LLMs, a lot of high quality unbiased data is needed. There is a lot of public data that is relevant for LLMs, but at times, that data can be too noisy and too large. Luckily, we have a solution. One that gathers large-scale data and cleans it by removing irrelevant or duplicate content. The result - structured format responses, that can be used to train LLMs effectively. Simply add the parameter output_format=text or output_format=markdown to the request structure. Here are some examples:

  • API REQUEST

require 'net/http'
require 'json'
params = {
:api_key => "API_KEY",
:url => "https://www.google.com/search?q=Carglass+GmbH+Halle+%28Saale%29+%28Stadtbezirk+Nord%29&hl=en",
:output_format => "OUTPUT_FORMAT"
}
uri = URI('https://api.scraperapi.com/')
uri.query = URI.encode_www_form(params)
website_content = Net::HTTP.get(uri)
print(website_content)
  • ASYNC REQUEST

require 'net/http'
require 'json'
require 'uri'
url = URI.parse("https://async.scraperapi.com/jobs")
headers = { "Content-Type" => "application/json" }
data = {
  "apiKey" => "API_KEY",
  "apiParams" => { "output_format" => "OUTPUT_FORMAT" },
  "url" => "https://www.google.com/search?q=Carglass+GmbH+Halle+%28Saale%29+%28Stadtbezirk+Nord%29&hl=en"
}
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url.path, headers)
request.body = data.to_json
response = http.request(request)
puts response.body
  • PROXY MODE - COMING SOON!

Sample Response

Markdown:

/# Accessibility Links

Skip to main content[Accessibility help](https://support.google.com/websearch/answer/181196?hl=en)

Accessibility feedback

[](https://www.google.com/webhp?hl=en&ictx=0&sa=X&ved=0ahUKEwjxgcn7ov2KAxVake4BHQb0DYwQpYkNCAo)

Press / to jump to the search box

Carglass GmbH Halle (Saale) (Stadtbezirk Nord)

[Sign in](https://accounts.google.com/ServiceLogin?hl=en&passive=true&continue=https://www.google.com/search%3Fq%3DCarglass%2BGmbH%2BHalle%2B%28Saale%29%2B%28Stadtbezirk%2BNord%29%26hl%3Den&ec=GAZAAQ)

# Filters and Topics

All

[Images](/search?sca%5Fesv=bca4d6818df5eb0f&hl=en&q=Carglass+GmbH+Halle+%28Saale%29+%28Stadtbezirk+Nord%29&udm=2&fbs=AEQNm0Aa4sjWe7Rqy32pFwRj0UkWd8nbOJfsBGGB5IQQO6L3J3BiN9fdhXvF2hIZnLYPFIpnRllAApQe54Ndkz8NZ2uq4JyeAShsPLKuiQt4w%5FkfDQb0vUvpRZ-tfSALXX7LTuUZ0j3vFCOGbXWbwDt55wNBVTSGsIdQjns%5F0jgvLA1%5FkZTbFN-119W9tHwJnaFRmMV8%5FhusR1diKA9zwo5dnLUwQE5gzw&sa=X&ved=2ahUKEwjxgcn7ov2KAxVake4BHQb0DYwQtKgLegQIExAB)

[Jobs](/search?sca%5Fesv=bca4d6818df5eb0f&hl=en&q=Carglass+GmbH+Halle+%28Saale%29+%28Stadtbezirk+Nord%29&udm=8&fbs=AEQNm0Aa4sjWe7Rqy32pFwRj0UkWd8nbOJfsBGGB5IQQO6L3J3BiN9fdhXvF2hIZnLYPFIpnRllAApQe54Ndkz8NZ2uq4JyeAShsPLKuiQt4w%5FkfDQb0vUvpRZ-tfSALXX7LTuUZ0j3vFCOGbXWbwDt55wNBVTSGsIdQjns%5F0jgvLA1%5FkZTbFN-119W9tHwJnaFRmMV8%5FhusR1diKA9zwo5dnLUwQE5gzw&sa=X&ved=2ahUKEwjxgcn7ov2KAxVake4BHQb0DYwQs6gLegQIDxAB)

[Maps](https://maps.google.com/maps?sca%5Fesv=bca4d6818df5eb0f&hl=en&output=search&q=Carglass+GmbH+Halle+%28Saale%29+%28Stadtbezirk+Nord%29&source=lnms&fbs=AEQNm0Aa4sjWe7Rqy32pFwRj0UkWd8nbOJfsBGGB5IQQO6L3J3BiN9fdhXvF2hIZnLYPFIpnRllAApQe54Ndkz8NZ2uq4JyeAShsPLKuiQt4w%5FkfDQb0vUvpRZ-tfSALXX7LTuUZ0j3vFCOGbXWbwDt55wNBVTSGsIdQjns%5F0jgvLA1%5FkZTbFN-119W9tHwJnaFRmMV8%5FhusR1diKA9zwo5dnLUwQE5gzw&entry=mc&ved=1t:200715&ictx=111)

[Shopping](/search?sca%5Fesv=bca4d6818df5eb0f&hl=en&q=Carglass+GmbH+Halle+%28Saale%29+%28Stadtbezirk+Nord%29&udm=28&fbs=AEQNm0Aa4sjWe7Rqy32pFwRj0UkWd8nbOJfsBGGB5IQQO6L3J3BiN9fdhXvF2hIZnLYPFIpnRllAApQe54Ndkz8NZ2uq4JyeAShsPLKuiQt4w%5FkfDQb0vUvpRZ-tfSALXX7LTuUZ0j3vFCOGbXWbwDt55wNBVTSGsIdQjns%5F0jgvLA1%5FkZTbFN-119W9tHwJnaFRmMV8%5FhusR1diKA9zwo5dnLUwQE5gzw&ved=1t:220175&ictx=111)

[Forums](/search?sca%5Fesv=bca4d6818df5eb0f&hl=en&q=Carglass+GmbH+Halle+%28Saale%29+%28Stadtbezirk+Nord%29&udm=18&fbs=AEQNm0Aa4sjWe7Rqy32pFwRj0UkWd8nbOJfsBGGB5IQQO6L3J3BiN9fdhXvF2hIZnLYPFIpnRllAApQe54Ndkz8NZ2uq4JyeAShsPLKuiQt4w%5FkfDQb0vUvpRZ-tfSALXX7LTuUZ0j3vFCOGbXWbwDt55wNBVTSGsIdQjns%5F0jgvLA1%5FkZTbFN-119W9tHwJnaFRmMV8%5FhusR1diKA9zwo5dnLUwQE5gzw&sa=X&ved=2ahUKEwjxgcn7ov2KAxVake4BHQb0DYwQs6gLegQIDBAB)

[Videos](/search?sca%5Fesv=bca4d6818df5eb0f&hl=en&q=Carglass+GmbH+Halle+%28Saale%29+%28Stadtbezirk+Nord%29&udm=7&fbs=AEQNm0Aa4sjWe7Rqy32pFwRj0UkWd8nbOJfsBGGB5IQQO6L3J3BiN9fdhXvF2hIZnLYPFIpnRllAApQe54Ndkz8NZ2uq4JyeAShsPLKuiQt4w%5FkfDQb0vUvpRZ-tfSALXX7LTuUZ0j3vFCOGbXWbwDt55wNBVTSGsIdQjns%5F0jgvLA1%5FkZTbFN-119W9tHwJnaFRmMV8%5FhusR1diKA9zwo5dnLUwQE5gzw&sa=X&ved=2ahUKEwjxgcn7ov2KAxVake4BHQb0DYwQtKgLegQICxAB)

More

About 269 results (0.29 seconds) 

Results for Halle (Saale)-Stadtbezirk Nord

 ∙ [Choose area](#)

# Search Results

# Main Results
.................

Text:

Please click here [/httpservice/retry/enablejs?sei=rZeKZ9COCOTAkPIP0p26oQk] if you are not redirected within a few seconds.

ACCESSIBILITY LINKS

Skip to main contentAccessibility help [https://support.google.com/websearch/answer/181196?hl=en]

Accessibility feedback
https://www.google.com/webhp?hl=en&sa=X&ved=0ahUKEwiQmZaHqP2KAxVkIEQIHdKOLpQQPAgI
https://www.google.com/webhp?hl=en&ictx=0&sa=X&ved=0ahUKEwiQmZaHqP2KAxVkIEQIHdKOLpQQpYkNCAo
Press / to jump to the search box
Carglass GmbH Halle (Saale) (Stadtbezirk Nord)

https://www.google.com/intl/en/about/products?tab=wh
Sign in [https://accounts.google.com/ServiceLogin?hl=en&passive=true&continue=https://www.google.com/search%3Fq%3DCarglass%2BGmbH%2BHalle%2B(Saale)%2B(Stadtbezirk%2BNord)%26hl%3Den&ec=GAZAAQ]

FILTERS AND TOPICS

All
Images
[/search?sca_esv=204cf606c36776c7&hl=en&q=Carglass+GmbH+Halle+(Saale)+(Stadtbezirk+Nord)&udm=2&fbs=AEQNm0Aa4sjWe7Rqy32pFwRj0UkWd8nbOJfsBGGB5IQQO6L3J3BiN9fdhXvF2hIZnLYPFIpnRllAApQe54Ndkz8NZ2uq4JyeAShsPLKuiQt4w_kfDQb0vUvpRZ-tfSALXX7LTuUZ0j3vFCOGbXWbwDt55wNBVTSGsIdQjns_0jgvLA1_kZTbFN-119W9tHwJnaFRmMV8_husR1diKA9zwo5dnLUwQE5gzw&sa=X&ved=2ahUKEwiQmZaHqP2KAxVkIEQIHdKOLpQQtKgLegQIEBAB]
Jobs
[/search?sca_esv=204cf606c36776c7&hl=en&q=Carglass+GmbH+Halle+(Saale)+(Stadtbezirk+Nord)&udm=8&fbs=AEQNm0Aa4sjWe7Rqy32pFwRj0UkWd8nbOJfsBGGB5IQQO6L3J3BiN9fdhXvF2hIZnLYPFIpnRllAApQe54Ndkz8NZ2uq4JyeAShsPLKuiQt4w_kfDQb0vUvpRZ-tfSALXX7LTuUZ0j3vFCOGbXWbwDt55wNBVTSGsIdQjns_0jgvLA1_kZTbFN-119W9tHwJnaFRmMV8_husR1diKA9zwo5dnLUwQE5gzw&sa=X&ved=2ahUKEwiQmZaHqP2KAxVkIEQIHdKOLpQQs6gLegQIDxAB]
Maps
[https://maps.google.com/maps?sca_esv=204cf606c36776c7&hl=en&output=search&q=Carglass+GmbH+Halle+(Saale)+(Stadtbezirk+Nord)&source=lnms&fbs=AEQNm0Aa4sjWe7Rqy32pFwRj0UkWd8nbOJfsBGGB5IQQO6L3J3BiN9fdhXvF2hIZnLYPFIpnRllAApQe54Ndkz8NZ2uq4JyeAShsPLKuiQt4w_kfDQb0vUvpRZ-tfSALXX7LTuUZ0j3vFCOGbXWbwDt55wNBVTSGsIdQjns_0jgvLA1_kZTbFN-119W9tHwJnaFRmMV8_husR1diKA9zwo5dnLUwQE5gzw&entry=mc&ved=1t:200715&ictx=111]
Shopping
[/search?sca_esv=204cf606c36776c7&hl=en&q=Carglass+GmbH+Halle+(Saale)+(Stadtbezirk+Nord)&udm=28&fbs=AEQNm0Aa4sjWe7Rqy32pFwRj0UkWd8nbOJfsBGGB5IQQO6L3J3BiN9fdhXvF2hIZnLYPFIpnRllAApQe54Ndkz8NZ2uq4JyeAShsPLKuiQt4w_kfDQb0vUvpRZ-tfSALXX7LTuUZ0j3vFCOGbXWbwDt55wNBVTSGsIdQjns_0jgvLA1_kZTbFN-119W9tHwJnaFRmMV8_husR1diKA9zwo5dnLUwQE5gzw&ved=1t:220175&ictx=111]
Forums
[/search?sca_esv=204cf606c36776c7&hl=en&q=Carglass+GmbH+Halle+(Saale)+(Stadtbezirk+Nord)&udm=18&fbs=AEQNm0Aa4sjWe7Rqy32pFwRj0UkWd8nbOJfsBGGB5IQQO6L3J3BiN9fdhXvF2hIZnLYPFIpnRllAApQe54Ndkz8NZ2uq4JyeAShsPLKuiQt4w_kfDQb0vUvpRZ-tfSALXX7LTuUZ0j3vFCOGbXWbwDt55wNBVTSGsIdQjns_0jgvLA1_kZTbFN-119W9tHwJnaFRmMV8_husR1diKA9zwo5dnLUwQE5gzw&sa=X&ved=2ahUKEwiQmZaHqP2KAxVkIEQIHdKOLpQQs6gLegQIDBAB]
Videos
[/search?sca_esv=204cf606c36776c7&hl=en&q=Carglass+GmbH+Halle+(Saale)+(Stadtbezirk+Nord)&udm=7&fbs=AEQNm0Aa4sjWe7Rqy32pFwRj0UkWd8nbOJfsBGGB5IQQO6L3J3BiN9fdhXvF2hIZnLYPFIpnRllAApQe54Ndkz8NZ2uq4JyeAShsPLKuiQt4w_kfDQb0vUvpRZ-tfSALXX7LTuUZ0j3vFCOGbXWbwDt55wNBVTSGsIdQjns_0jgvLA1_kZTbFN-119W9tHwJnaFRmMV8_husR1diKA9zwo5dnLUwQE5gzw&sa=X&ved=2ahUKEwiQmZaHqP2KAxVkIEQIHdKOLpQQtKgLegQIChAB]
More

About 269 results (0.29 seconds) 

Results for

Halle (Saale)-Stadtbezirk Nord
 ∙ Choose area

SEARCH RESULTS

MAIN RESULTS
PreviousRequest JSON Response via Autoparse Parameter in RubyNextRequest Response Encoding and Content-Type via ScraperAPI in Ruby

Last updated 3 months ago

Was this helpful?