Need help understanding API
-
I know what information I need to pull... I know I need APIs to do it... I just don't know how to pull it or where. I have tools like Screaming Frog, Scrapebox, SEMRush, Moz, Majestic, etc. I need to find out how to type in a query and pull the top 10 ranking specs like DA, PA, Root Domains, Word Count, Trust Flow, etc.
Here is a screenshot of info I manually pulled...
https://screencast.com/t/H1q5XccR8 (I can't hyperlink it... it's giving me an error)
How do I auto pull this info??
-
There's no single API that does all of this but you can chain a couple of them together to get what you want. As Tawny pointed out, it's a technical task and you may need the help of a web developer.
As you have access to SEMRush, you can use their "organic results" API call which, given the keyword you're interested in, will return the top ranking URLs. You can see the documentation specific to that call here. So that gets you from your starting point (being interested in a query) to having the top URLs. You can limit the number of rows returned by the SEMRush API—sounds like you'd only want the first 10 rows (i.e. the top 10 results for the keyword).
Now taking that list you can send it to the Moz API's UrlMetrics call. This will give you back DA, PA, Trust Flow, and so on, for each URL.
Neither tool will tell you the word count. If you need to calculate that, you'll have to crawl the pages somehow. It depends whether you really need to completely automate everything. If "semi-automation" is good enough, I'd suggest that your script, after fetching the top ranking URLs from SEMRush, writes them out to a CSV as well. Then you can use Screaming Frog in list mode to crawl all of the URLs listed in the CSV. So everything would be automated except for gathering the word counts. You'd have to stitch together the results from your Screaming Frog crawl with the data you had back from Moz.
If everything must be automated, and you really need word count or other on-page information, your script will also need to crawl the pages. And for this you'll certainly need a developer familiar with technologies like Selenium, for crawling and scraping web pages. In almost all use cases, that's overkill, so I'd suggest focussing on the SEMRush and Moz APIs for now.
-
Hey there!
Tawny from Moz's Help Team here.
Our API doesn't contain all those metrics — what we're able to pull in through the Mozscape API is the same kind of data you'd be able to get through Open Site Explorer, but in bulk. You can read about all the different kinds of data you can collect with the API over here, in our Help Hub pages: https://moz.com/help/guides/moz-api/mozscape/api-reference
You can read more about how to use it and get started from this page: https://moz.com/help/guides/moz-api/mozscape/getting-started-with-mozscape/create-and-manage-your-account
The API is a pretty technical tool, so you may need a web developer's help to interpret the responses you get. If you have any more questions, feel free to reach out to us at help@moz.com and we'll do our best to answer any questions you might have.
Cheers!
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Unsolved Mozscape API subscription
We have questions regarding our subscription and the plan we are on. We are more interested in Mozscape API and not the features that we have access to currently. Will you let us know how we can change. Is there some one that we can chat with. Thanks,
API | | PatientPop
Naveen
naveen.sarabu@patientpop.com0 -
Paid access to the API
Hi!
API | | SlemmaDev
We paid for the trial period, but we don't have access to the API (Anchor-Text Metrics, and to the other paid URL Metrics). Why? Thanks!0 -
"403 Forbidden" is they will be displayed in the "API"
Nice to meet you.
API | | yamayamax
Although the future API of the question of "URL Metrics", I want you to forgive me English is very immature thing. I'm very troubled now.
If you call the "API" in the manner described below, such PHP of the program, "403 Forbidden" is the result.
Because the information when you visit the URL directly is displayed, we suspect the PHP of the problem.
About the cause, it will be saved in a very and Nowak advice.
Whether Thank you. code $accessID = "<removed for="" privacy="">";
$secretKey = "<removed for="" privacy="">";
$expires = time() + 300;
$SignInStr = $accessID. "\n" .$expires;
$binarySignature = hash_hmac('sha1', $SignInStr, $secretKey, true);
$SafeSignature = urlencode(base64_encode($binarySignature));
$objURL = "http://www.google.com";
$flags = "103079217188";
$reqUrl = "http://lsapi.seomoz.com/linkscape/url-metrics/".urlencode($objURL)."?Cols=".$cols."&AccessID=".$accessID."&Expires=".$expires."&Signature=".$SafeSignature;
$opts = array(CURLOPT_RETURNTRANSFER => true);
$curlhandle = curl_init($reqUrl);
curl_setopt_array($curlhandle, $opts);
$content = curl_exec($curlhandle);
curl_close($curlhandle);
$resObj = json_decode($content); //decode the json object and fetch results
echo $reqUrl . "
";
echo "Domain Authority : " . $resObj->{'pda'};
echo "Page Authority : " . $resObj->{'upa'};
?>
------------------------------------------------------------------------------------</removed></removed>0 -
API for crawl reports?
Hello, I'd like to know if moz api is able to provide me the crawl reports. We're currently developing a simple crawl report analysis/parsing tool and after analysing the API we weren't able to find a function that could return us wether the excel file or the report results. Is there any way? Thank you very much.
API | | PLOT_PT0 -
3 result limit to Top Pages API call
I am using the MOZ API to make calls for the top pages for a particular URL. However, when I pass in any limit value greater than 3 the API only returns 3 results. I have even tried to put in URLs like 'www.moz.com' and still only 3 results. Sample call to the API below: http://lsapi.seomoz.com/linkscape/top-pages/www.moz.com?AccessID=member-xxxxxxxxx&Expires=1419020831&Signature=xxxxxxxxx&Cols=2052&Offset=0&Limit=50
API | | solodev0 -
Seo moz api request problem [401 error_message Your authentication failed]
Hello Team, I have moz pro account. I'm getting following error for seomoz call using your API: {"status":"401","error_message":"Your authentication failed. Check your authentication details and try again. For more information on signed authentication, see: http://apiwiki.moz.com/signed-authentication"} The link that we are using is:
API | | eBrandz
http://lsapi.seomoz.com/linkscape/url-metrics/ And following bits are requested during the call: 68719476736 34359738368 32 2048 16384 The error is intermittent. It comes and goes. There were no issues with results 3 days ago. I suddenly started getting this error. Could you please investigate into it and let me know the cause of issues and its correctiveness. It will great if you can provide us a support email Id for immediate response. Thanks,0 -
About Expiry of MOZ API authentication and MOZ API call in .NET application
MOZ API signed authentication is getting expire after particular time, and coming up with the error "Authentication has expired , Re-send your authentication". **right now we are getting new authentication details using ** https://moz.com/products/api/keys after doing login. but, how do we get new credentials (authentication details) , by doing MOZ API call using c# or any other programming language, we are using this API in .NET. Also, How we can increase the session expiry time. i think it is concerned with the Sample Expires of Signed authentication , but we are unable to change it , as it is coming with the authentication failed.
API | | BenuAggarwal0 -
API: General information URL on path level
Is it possible to get general information (refdomains, mozrank etc.) out of the API on path level? If so, what is the best way to do this? Example www.test.com/folder/ -> Combined data (for example, total refdomains etc) for all URL’s indexed by Moz that include www.test.com/folder/ -> like www.test.com/folder/item/page.html and www.test.com/folder/page2.html
API | | MerkleNederland0