Skip to main content

Similarweb Scraper API

Written by Kadri - RichAPI Support Team

POST /similarweb_scraper_sync • Credits: 2 credits per returned result

Similarweb Scraper reads the Similarweb overview of one domain and returns traffic and engagement estimates for that domain. The response is a JSON array, and each object holds the global rank, the total visits, the top keywords and the similar sites. Each object in that array costs 2 credits, or $0.04 on the 1,000 and 5,000 credit packs.

What does Similarweb Scraper do?

Growth teams and product teams need traffic figures for a competitor domain. A competitor publishes no analytics, so the figures must come from a third-party estimate. Similarweb Scraper reads the public Similarweb overview page for one domain and returns the estimate as JSON. The result holds the traffic volume, the category, the global rank, the top search keywords and a list of similar sites. One request covers one domain, and RichAPI charges 2 credits for each object in the response array. The data source is Similarweb.

Which endpoint does Similarweb Scraper use?

  • Method:POST

  • URL:https://api.richapi.ai/api/v1/similarweb_scraper_sync

  • Authentication:x-api-key header

  • Request format: JSON request body

  • Response: Synchronous JSON array

  • Domains per request: 1

  • Credits: 2 credits per returned result

  • Credit hold per request: 100 credits

Similarweb Scraper accepts the POST method only. Every parameter goes in the JSON request body. If you send GET, the API returns 405 with the message similarweb_scraper_sync only supports POST.

How to send a Similarweb Scraper request

  1. Copy your API key from the RichAPI dashboard.

  2. Make sure that the organization balance is 100 credits or more.

  3. Set the competitor domain as domain in the JSON request body.

  4. Write the domain without a scheme and without a path, for example stripe.com.

  5. Send the request as POST to https://api.richapi.ai/api/v1/similarweb_scraper_sync.

  6. Read the first object in the returned JSON array.

CAUTION: Keep the organization balance at 100 credits or more. RichAPI holds 100 credits at the start of every Similarweb Scraper request. If the balance is under 100 credits, the request returns 402 and costs no credit.

cURL

curl -X POST https://api.richapi.ai/api/v1/similarweb_scraper_sync   
-H "x-api-key: YOUR_API_KEY"
-H "Content-Type: application/json"
-d '{
"domain": "stripe.com"
}'

Python

import requests

response = requests.post(
"https://api.richapi.ai/api/v1/similarweb_scraper_sync",
headers={"x-api-key": "YOUR_API_KEY"},
json={"domain": "stripe.com"},
timeout=120,
)
response.raise_for_status()
results = response.json()
print(results[0] if results else "no result")

Node.js

const response = await fetch(
"https://api.richapi.ai/api/v1/similarweb_scraper_sync",
{
method: "POST",
headers: {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({ domain: "stripe.com" }),
}
);

const results = await response.json();
console.log(results[0] ?? "no result");

What parameters does Similarweb Scraper accept?

Parameter

Type

Required

Default

Description

domain

string

Yes

none

The domain to analyze, for example stripe.com. One domain per request.

domain is the only parameter that Similarweb Scraper accepts, and it is required on every request.

CAUTION: Do not send a list of domains in domain. The parameter accepts one domain string. An array returns 400 with the message Invalid value for domain: expected string.

If you send any other field in the request body, the API returns 400 with the message Unknown input field(s): and the field name.

Which Similarweb data set does the response hold?

Similarweb Scraper returns the overview data set with the similar sites. It does not return the in-depth data set, and no parameter turns it on.

What does Similarweb Scraper return?

Similarweb Scraper returns a JSON array. Each element in the array is one Similarweb overview object for one domain. The block below is an example response for the domain stripe.com. The values are illustrative.

[
{
"domain": "stripe.com",
"category": "computers_electronics_and_technology/programming_and_developer_software",
"rankGlobal": 1043,
"totalVisits": 28450000,
"engagement": {},
"topKeywords": [],
"similarSites": []
}
]

One domain per request returns one object, so a normal Similarweb Scraper call returns an array of one element. That call costs 2 credits.

Which fields does a Similarweb Scraper result hold?

Field

Type

Description

domain

string

The domain that the object describes.

category

string

The Similarweb category of the domain.

rankGlobal

number

The global traffic rank of the domain. A lower number means more traffic.

totalVisits

number

The estimated total visits to the domain.

engagement

object

The engagement estimates for the domain.

topKeywords

array of object

The top search keywords that send traffic to the domain.

similarSites

array of object

The sites that Similarweb ranks as similar to the domain.

How much does Similarweb Scraper cost?

Similarweb Scraper costs 2 credits for each object in the response array. RichAPI counts the objects in the returned JSON array and multiplies that count by 2. The call carries no base fee. One credit costs $0.02 on the 1,000 and 5,000 credit packs, so one result costs $0.04 there. Larger packs cost less per credit.

Results returned

Credits

Cost

0

0

$0.00

1

2

$0.04

10

20

$0.40

25

50

$1.00

50

100

$2.00

One request covers one domain, so the cost of a domain list is the cost of one request multiplied by the number of domains. The next table shows the total for a list of competitor domains at one result per domain.

Domains

Requests

Results

Credits

Cost

1

1

1

2

$0.04

10

10

10

20

$0.40

50

50

50

100

$2.00

100

100

100

200

$4.00

500

500

500

1,000

$20.00

How does the 100-credit hold on Similarweb Scraper work?

RichAPI holds 100 credits at the start of every Similarweb Scraper request. The hold covers up to 50 results at 2 credits each. The hold is not a charge, and it is not a batch limit. After the response arrives, RichAPI charges 2 credits for each object in the array and releases the rest of the hold.

Step

Credits

Hold at the start of the request

100

Charge for a response of one object

2

Released back to the balance

98

If the organization balance is under 100 credits, the request returns 402 with the message Insufficient credits and returns no Similarweb data. RichAPI charges credits only for a response in the 200 range. Any other response releases the whole hold and costs no credit.

How to research a list of competitor domains

Similarweb Scraper takes one domain per request. For a list of competitors, send one request per domain and collect the results.

  1. Write the competitor domains in a list, one domain per entry.

  2. Strip the scheme and the path from every domain.

  3. Send one Similarweb Scraper request per domain.

  4. Read the first object in each returned array.

  5. Compare totalVisits and rankGlobal across the results.

  6. Multiply the count of returned objects by 2 to get the credit charge.

The worked example below covers 12 competitor domains.

  • Competitor domains in the list: 12

  • Domains per request: 1

  • Requests sent: 12

  • Objects returned: 12

  • Credits charged: 24

  • Total cost: $0.48

Twelve requests return 12 objects. Twelve objects at 2 credits each cost 24 credits, and 24 credits cost $0.48 on the 1,000 and 5,000 credit packs. If 2 of the 12 domains return an empty array, RichAPI charges for 10 objects only. Ten objects cost 20 credits, which cost $0.40.

import requests

API_KEY = "YOUR_API_KEY"
URL = "https://api.richapi.ai/api/v1/similarweb_scraper_sync"

domains = [
"stripe.com",
"adyen.com",
"checkout.com",
"braintreepayments.com",
]

overviews = []
for domain in domains:
response = requests.post(
URL,
headers={"x-api-key": API_KEY},
json={"domain": domain},
timeout=120,
)
response.raise_for_status()
overviews.extend(response.json())

print("domains sent:", len(domains))
print("results returned:", len(overviews))
print("credits charged:", len(overviews) * 2)

CAUTION: Send the requests one after the other. A burst of requests returns 429 with a Retry-After header, and a 429 response costs no credit.

How accurate are Similarweb traffic estimates?

Similarweb traffic figures are estimates, and they are not measured analytics. Similarweb models the traffic of a domain from third-party sources. The domain owner reports nothing to Similarweb, so the figures never match the analytics tool of the site. Treat totalVisits, rankGlobal and engagement as directional numbers.

Three rules keep the data useful:

  1. Compare domains against each other, and not against an absolute target.

  2. Track the direction of a number over time, and not the exact value.

  3. Confirm a large decision with a second data source.

Similarweb estimates are strongest for a large domain with steady traffic. The estimate for a small domain carries a wider error range, because the sample behind it is smaller.

Which errors does Similarweb Scraper return?

Status

Meaning

What to do

400

The request body failed validation.

Correct the field that the message names. Send domain only, as a string.

401

The API key is missing or wrong.

Send a valid key in the x-api-key header.

402

The organization balance is under the 100-credit hold, or the team reached its monthly spend limit.

Buy credits in the RichAPI dashboard, then send the request again.

403

The API key has no access to this endpoint.

Check the endpoint list of your plan in the dashboard.

405

The request used a method other than POST.

Send the request as POST with a JSON request body.

429

Too many requests.

Read the Retry-After header, wait, then send the request again.

500

The API failed.

Send the request again. If the failure repeats, write to [email protected].

502

The data source failed.

Send the request again after a short wait.

504

The data source timed out.

Send the request again after a short wait.

Frequently asked questions

How many domains can one Similarweb Scraper request take?

One. The Similarweb Scraper request body holds a single domain string, and the RichAPI validator rejects an array with 400. For a list of domains, send one request per domain.

Does the 100-credit hold mean a batch of 50 domains?

No. The hold covers up to 50 results at 2 credits each. Similarweb Scraper takes one domain per request, and the charge follows the number of objects in the response.

How does RichAPI count the credits for Similarweb Scraper?

RichAPI counts the objects in the returned JSON array and charges 2 credits for each object. A response with one overview object costs 2 credits.

Does a Similarweb Scraper request that finds no data cost credits?

No. A request that returns an empty JSON array costs 0 credits, because RichAPI charges per returned object and adds no base fee. RichAPI releases the whole 100-credit hold.

Can I turn on the in-depth Similarweb data set?

No. Similarweb Scraper returns the overview data set only, and the request body accepts domain only. Any other field returns 400 with the message Unknown input field(s): and the field name.

Is Similarweb Scraper synchronous?

Yes. Similarweb Scraper returns the full JSON array in the response of the same POST call. There is no job ID and no polling step.

How does Similarweb Scraper compare with Website Intelligence?

Similarweb Scraper returns third-party traffic and engagement estimates for a domain. Website Intelligence reads the website itself and returns the content and the company data on it.

Related articles

Did this answer your question?