Quickstart
Scraping Fish is dead easy to use. All you need to do is provide your API key and the URL you want to scrape as query parameters to Scraping Fish API endpoint. In the response, you receive the desired website's HTML.
This guide will get you all set up and ready to use the Scraping Fish API. We'll cover how to get started and make your first API request. We'll also look at where to go next to find all the information you need to take full advantage of our powerful API.
Before you can make requests to the Scraping Fish API, you will need to grab your API key from the email you have received when buying a pack or your dashboard. You find it under Account » API Key.
Making your first API request
As Scraping Fish is an API accessible over HTTP, you can use virtually any environment you want to make your first call to the Scraping Fish API. Below, you can see how to send a basic request.
import requests
payload = {
"api_key": "[your API key]",
"url": "https://example.com",
}
response = requests.get("https://scraping.narf.ai/api/v1/", params=payload)
print(response.content)
In response, you get the HTML:
<!doctype html>
<html>
…
<body>
<div>
<h1>Example Domain</h1>
<p>
This domain is for use in illustrative examples in documents. You may
use this domain in literature without prior coordination or asking for
permission.
</p>
<p>
<a href="https://www.iana.org/domains/example">More information...</a>
</p>
</div>
</body>
</html>
If the URL you want to scrape contains query parameters, for example https://httpbin.org/get?best_api=scrapingfish&website=https://scrapingfish.com, you need to encode the URL. Using requests Python package or axios in NodeJS, parameters are automatically URL-encoded, unless you construct the URL manually with template strings.
If the request somehow fails, you won't be charged. Read more about possible response status codes in the dedicated section.
What's next?
Great, you have made your first request to the API. Here are a few links that might be handy as you venture further into the Scraping Fish API: