Your Step-By-Step Guide to Conducting a Bulk Domain Analysis With SE Ranking’s API

1 month ago 305
ARTICLE AD BOX

Analyzing thousands of domains for SEO insights tin beryllium tiresome. It often requires important clip and resources, but you tin usage API exertion to marque the process of conducting bulk domain checks much accessible and efficient. This makes it easier to analyse competitory niches and find amended impermanent blogging opportunities. In this article, we volition research however SE Ranking’s API empowers users to execute broad domain investigation astatine scale. You’ll observe however this translates to invaluable insights that tin greatly streamline your workflow and thrust amended results for your SEO projects. We volition besides look astatine the antithetic ways you tin integrate this API into your SEO routine.

Let’s leap close in!

TL;DR

To get domain information for aggregate websites, you tin utilize our API, specifically the Competitive Research and Backlink Checker API. These APIs supply broad information, specified arsenic integrated traffic, keyword count, domain spot score, referring domains, backlinks, and more. What’s adjacent better, you don’t request coding skills to utilize these APIs.

To get domain investigation information with Python, you indispensable tally a codification successful Google Colab. Once executed, the results volition beryllium displayed successful Google Sheets. To presumption each metric individually, use a circumstantial look successful the table. You tin prime the metrics that you need. 

All of this information volition assistance you behaviour speedy competitory and niche analysis, measure the backlink illustration of each domain, oregon execute different types of SEO analysis.

An overview of APIs: what are they and however bash they work?

The SE Ranking squad has created several APIs. They were designed to simplify your work, some with large-scale domain information analytics and different SEO tasks. Now you tin retrieve earthy information without having to manually log into the SE Ranking platform. This is perfect for companies that negociate tons of information and accounts (i.e., SEO agencies).

This API is disposable with a Business subscription only.

To analyse domains successful bulk with SE Ranking, usage the pursuing 2 APIs: Competitive Research and Backlink Checker

The Competitor Research API presents a convenient format for accessing domain statistic from some integrated and paid hunt results, including traffic, keywords, and different metrics. Meanwhile, the Backlink Checker API provides information that you tin usage to behaviour backlink illustration analyses. Both of these APIs combined connection astir each the numeric metrics disposable connected the level versions of these tools.

Here are immoderate of the cardinal metrics available.

Competitive Research API:

  • Total domain postulation wrong the specified location
  • Number of keywords a domain ranks for successful the specified location
  • Number of recently acquired keywords
  • Number of keywords that person dropped from the SERPs
  • Number of keywords with accordant ranking positions
  • Number of keywords with improved ranking positions
  • Number of keywords with decreased ranking positions
  • Total fig of keywords ranked successful positions 1-5, 6-10, and 11-20
  • And more

Backlink Checker API:

  • Domain Trust score
  • Total fig of backlinks for the URL
  • Total fig of referring domains for the URL
  • Total fig of dofollow/nofollow backlinks
  • And more

This isn’t the implicit list. You tin find each parameters successful our Backlink Checker API and Competitor Research API documents.

How to optimize your workflow with our API 

You don’t request to cognize however to codification to afloat utilize our APIs. Simply tally the provided Python codification and entree the results done Google Sheets. 

Let’s statesman by taking a person look astatine the codes you volition beryllium moving with.

Available codes

You tin behaviour a domain investigation utilizing 1 of the pursuing 2 scripts.

1. [Competitive Research + Backlink Checker API] 

Pros: You get much information from 2 modules astatine once.

Cons: You inactive expend Backlink Checker credits. Due to the ample magnitude of information to process, the codification operates slower.

You volition request to transcript and paste the codification beneath into Google Colab. But delight enactment that you indispensable adhd your API cardinal to the api_key parameter. This tin beryllium recovered wrong the API section of SE Ranking’s Settings

API cardinal  wrong   the API conception  of SE Ranking’s Settings

Competitive Research + Backlink Checker API code:

import requests import gspread from google.colab import auth, drive from oauth2client.client import GoogleCredentials import pandas arsenic pd from gspread_dataframe import set_with_dataframe from google.auth import default auth.authenticate_user() creds, _ = default() def read_table(table_name:str) -> pd.DataFrame: gc = gspread.authorize(creds) worksheet = gc.open(table_name).sheet1 rows = worksheet.get_all_values() frame = pd.DataFrame.from_records(rows) frame.columns = frame.iloc[0] frame = frame.drop(index=[0]) frame = frame.fillna('') return frame def save_table(table_name:str, dataframe:pd.DataFrame) -> None: gc = gspread.authorize(creds) worksheet = gc.open(table_name).sheet1 set_with_dataframe(worksheet, dataframe) def request_to_api(research:pd.DataFrame) -> list: effect = list() for index, enactment successful research.iterrows(): domain = row['domain'] research_result = get_research_api_result(domain) backlinks_result = get_backlinks_api_result(domain) if (row['backlinks'] == '') other row['backlinks'] result.append([domain, research_result, backlinks_result]) instrumentality result def get_api_headers() -> str: api_key = 'ADD YOUR API KEY' instrumentality dict(Authorization=api_key) def get_research_api_result(domain:str) -> str: params = dict(domain=domain) api_url = 'https://api4.seranking.com/research/uk/overview/?' effect = requests.get(api_url, params=params, headers=get_api_headers()) instrumentality result.json() def get_backlinks_api_result(domain:str) -> str: study = create_backlink_checker_report(domain) report_id = str(report.get('report_id')) api_url = 'https://api4.seranking.com/backlink-reports/' + report_id + '/overview' effect = requests.get(api_url, headers=get_api_headers()) delete_backlink_checker_report(report_id) instrumentality result.json() def create_backlink_checker_report(domain:str) -> str: params = dict(mode='domain', target=domain) api_url = 'https://api4.seranking.com/backlink-reports' effect = requests.post(api_url, json=params, headers=get_api_headers()) instrumentality result.json() def delete_backlink_checker_report(report_id:str) -> None: api_url = 'https://api4.seranking.com/backlink-reports/' + report_id requests.delete(api_url, headers=get_api_headers()) def main(): table_name = 'competitive-research-API' array = read_table(table_name) result_table_requests_to_api = request_to_api(table) result_table_to_dataframe = pd.DataFrame(result_table_requests_to_api, columns=['domain', 'result', 'backlinks']) save_table(table_name, result_table_to_dataframe) main()

2. [Competitive Research API] 

Pros: The publication operates faster, and you don’t usage up credits.

Cons: You get little information and bash not person accusation connected domain spot (domain authority), fig of backlinks, referring domains, etc.

Competitive Research code:

Don’t hide to input your API cardinal into the api_key parameter.

import requests import gspread from google.colab import auth, drive from oauth2client.client import GoogleCredentials import pandas arsenic pd from gspread_dataframe import set_with_dataframe from google.auth import default auth.authenticate_user() creds, _ = default() def read_table(table_name:str) -> pd.DataFrame: gc = gspread.authorize(creds) worksheet = gc.open(table_name).sheet1 rows = worksheet.get_all_values() frame = pd.DataFrame.from_records(rows) frame.columns = frame.iloc[0] frame = frame.drop(index=[0]) frame = frame.fillna('') return frame def save_table(table_name:str, dataframe:pd.DataFrame) -> None: gc = gspread.authorize(creds) worksheet = gc.open(table_name).sheet1 set_with_dataframe(worksheet, dataframe) def request_to_api(research:pd.DataFrame) -> list: effect = list() for index, enactment successful research.iterrows(): domain = row['domain'] research_result = get_research_api_result(domain) result.append([domain, research_result]) instrumentality result def get_api_headers() -> str: api_key = 'ADD YOUR API KEY' instrumentality dict(Authorization=api_key) def get_research_api_result(domain:str) -> str: params = dict(domain=domain) api_url = 'https://api4.seranking.com/research/uk/overview/?' effect = requests.get(api_url, params=params, headers=get_api_headers()) instrumentality result.json() def main(): table_name = 'competitive-research-API' array = read_table(table_name) result_table_requests_to_api = request_to_api(table) result_table_to_dataframe = pd.DataFrame(result_table_requests_to_api, columns=['domain', 'result']) save_table(table_name, result_table_to_dataframe) main()

Here are a fewer cardinal parameters to wage attraction to:

  • This is however your API cardinal appears successful the code:
API cardinal  successful  a code
  • In api_url, you tin alteration the determination from which to retrieve traffic/keyword data. 
api_url parameter successful  a code
  • These are the columns successful your Google Sheets file.
Name of columns successful  Google Sheets file

Now, let’s determination connected to our step-by-step usher to utilizing these codes.

How to usage it

Step 1. Open Google Colab, make a caller notebook and paste 1 of the 2 codes provided successful the erstwhile section.

Step 2. Open the Colab Notebooks folder successful your Google Drive and make a Google Sheet file.

Colab Notebooks folder successful  Google Drive

Note: Ensure that the record sanction is an nonstop lucifer with the table_name successful the code, arsenic shown successful the illustration below.

Table sanction  successful  a code
Table sanction  for API

Step 3. Assign names to the columns based connected the publication being used. If utilizing the Competitive Research API publication exclusively, columns A and B should beryllium called domain and result, respectfully. For the Competitive Research and Backlink Checker API scripts, successful summation to the domain and result columns, you request to adhd a 3rd file called backlinks

See the screenshot beneath showing the 2nd mentation with 3 columns. 

If necessary, you tin rename the columns and update the codification accordingly.

Then, participate your domains successful the archetypal file without http:// and www.

List of domains to analyse  with API

Step 4: Go to Colab, click the fastener to tally the code, and assistance entree if required.

Running codification  successful  Google Colab

Step 5: After the publication finishes running, cheque backmost into the Google Sheets record astatine a aboriginal clip to get the results. Here’s what the array volition look like:

Table with API data

Step 6. To isolate the metric you specified, extract it from the JSON data. Just input the =REGEXEXTRACT relation oregon travel up with your ain solution. Below is the look for accessing the traffic_sum parameter, which represents the full integrated postulation successful a specified location:

=REGEXEXTRACT(B2,”traffic_sum’:\s([0-9]+)”)

  • B2 is the file containing your JSON information (i.e., your result column). If you request information from different column, you tin alteration it successful the formula.
  • traffic_sum is the metric of interest. If you privation to retrieve different data, you tin alteration this parameter successful the formula. 
  • \s([0-9]+) is the regular look that searches for sequences wherever the whitespace quality is instantly followed by 1 oregon much digits. You don’t request to alteration it. 

Step 7. Once you person entered the look into the archetypal cell, resistance it down to transcript the look to each cells. Be definite to get information from each domain connected the list.

=REGEXEXTRACT function

Here is simply a database of cardinal metrics that you tin usage successful formulas to get important domain data:

  • keywords_count — Total fig of keywords a domain ranks for successful the specified location.
  • top1_5 — Total fig of keywords that fertile successful the apical 1-5.
  • keywords_new_count — Total fig of caller keywords.
  • domain_inlink_rank — Domain Trust score.
  • total_domains — Total fig of referring domains for a URL.
  • total_backlinks — Total fig of backlinks for a URL.

You tin find each of these metrics successful JSON format successful our Backlink Checker API (for the backlinks column) and Competitor Research API (for the result column) documents.

Exploring API usage cases

Wondering however tin this information payment you? Let’s research immoderate areas successful SEO wherever you tin payment from API.

  • Competitive and niche analysis

You tin measure the spot of your competitors (or domains successful your niche) based connected factors specified arsenic integrated traffic, fig of keywords, backlinks, and domain trust. This helps you gauge the wide competitiveness of the niche and wherever you basal compared to these websites.

To grow your domain database and find much websites from wrong your niche, you tin get SERP results for the keywords successful your niche. Just usage SE Ranking’s SERP Competitors feature nether the My Competitors tab to get this information. 

Here’s how:

  1. Select the desired keyword radical from the dropdown paper (ensure that you person antecedently added each indispensable keywords to a azygous radical wrong the project).
  2. Choose however galore results from the SERP you request (100/50/30/20/10).
  3. Select the Domain mode.
SE Ranking's SERP Competitors diagnostic   nether  the My Competitors tab

Then, export data. Select the All keywords from the group enactment to get a database of domains that fertile successful the apical 10-100 for the keywords you privation to examine.

Export SERP information  from SE Ranking

After you person chosen the websites you privation to examine, adhd them to the Google Sheets record and behaviour a domain SEO analysis. It volition comparison the integrated traffic, fig of keywords, backlinks, referring domains, and domain spot scores of these sites. This tin supply invaluable insights into your niche’s competitory landscape.

Domain SEO investigation  with SE Ranking's API

To behaviour an in-depth competitory analysis, usage specialized tools similar SE Ranking’s Competitive Research and Backlink Checker.

  • Guest blogging and integer PR

You tin besides streamline your link building efforts by pinpointing the astir applicable domains to interaction for imaginable collaboration opportunities. Conducting a speedy archetypal probe survey with API helps you measure domain prime earlier committing to investing successful further resources. 

For instance, you tin measure their integrated postulation and Domain Trust scores to pinpoint imaginable sources for deeper investigation and further collaboration outreach. While this attack whitethorn not connection insights into tract relevance and different important qualitative metrics, it is simply a bully starting constituent for your campaign. 

Total postulation   and Domain Trust for domains

Wrapping up

SE Ranking’s API functionality is an perfect solution for businesses managing aggregate large-scale projects astatine once. It smoothens the process of analyzing immense datasets and automating SEO processes.

We anticipation that the API codes and usher we provided assistance simplify your bulk domain investigation efforts. We designed our APIs for everyone, adjacent those without coding skills.

Daria is simply a contented marketer astatine SE Ranking. Her interests span crossed SEO and integer marketing. She likes to picture analyzable things successful plain words. In her escaped time, Daria enjoys traveling astir the world, studying the creation of photography, and visiting creation galleries.