How can we view and extract other data from the JSON?

A rich source of U.S. data covering demographics, economy, geography, and more.
Post Reply
Irfanabdulla1111
Posts: 59
Joined: Mon Dec 23, 2024 3:45 am

How can we view and extract other data from the JSON?

Post by Irfanabdulla1111 »

And through the instruction sheet.getRange(1,1).setValue() the value that was going to be printed in our Excel sheet was indicated, generating the following line of code by joining both lines:


If we wanted to extract another piece of data, we would only have to identify where it is located and use chuckNorrisObject to indicate, using a point, the path to reach the element we want to extract from the JSON.

Function to extract information from keyword positions
The function of a project's keyword positions is somewhat more complex:


Function to extract information from keyword positions
Idproject : is the project identifier.

KEY – This is the API key for our SEMrush account.

Oldest_date : Here we must insert the oldest date with the following format yyyymmdd.

Newest_date : here we will insert the date closest to the current one with the following format yyyymmdd.

Domain_name : here we are going to insert the domain with the extension without www and w email list providers in germany ithout http or https, only the domain name with the domain extension.

display_limit=100 : This variable tells us the maximum number of rows of words we are going to display. I inserted 100 but you can increase or decrease it depending on the project.



Keyword positions with SEMrush API and script apps
Result of all the code to extract the value from the Siteaudit and the positions from the Position Report
I have explained how to extract the Siteaudit of a project and the positions of the keywords that we are interested in having more controlled in a project.

All together, the code looks like this, without comments:


SEMrush API Connection with Apps Scripts for Spreadsheets
If you want to run the script automatically without having to use the created menu buttons, you would just have to click on the clock located in the top menu of Google Apps Script to schedule when you want the code to run automatically.

If we did this, we could remove the feature from the menu as it would not be needed.

It is important to calculate the consumption of the SEMrush API before moving on to automatic execution of the script, as it is limited and it may be necessary to increase the investment.

As an extra, I have created a GIT repository to actively collaborate in the development of the application.

In addition, I will be updating new developments within this.
Post Reply