Can the API Filter Links with Certain Anchor Text?
-
I am trying to get all links that have a certain strings in their anchor text: I am using the python library: https://github.com/seomoz/SEOmozAPISamples/blob/master/python/lsapi.py
Looking at the documentation, it says I can get the normalized anchor text by using the bit flag 8 for the LinkCols value:
https://moz.com/help/guides/moz-api/mozscape/api-reference/link-metrics
So I tried this:
links = l.links('example.com', scope='page_to_domain', sort='domain_authority', filters=['external'], sourceCols = lsapi.UMCols.url, linkCols=8)
But it doesn't return the expected 'lnt' response field or anything similar to the anchor text. How do I get the anchor text on the source URLs?
I also tried 10 for the linkCols value, to get all the bit flags in the lf field as well as the anchor text. In both instances (and even with different variations of targetCols & sourceCols), this is all the fields that are returned:
'lrid', 'lsrc', 'luuu', 'uu', 'luupa', 'ltgt'
-
Is there a chance to use Moz API in Python? According to the pricing of Moz maybe it is free?
-
I had built a pull request for this issue, but thank you for jumping on it yourself. I'll try it tomorrow. Marking this as complete. I'll re-open if there's any issues. Thanks!
-
I've just fixed the code with this latest pull request:
https://github.com/seomoz/SEOmozAPISamples/pull/17
If you download the latest version it should be fixed for you now.
-
Hi Nathan,
I am the manager of the team looking after the API. I am sorry that snippet does not seem to work. I'll get one of the team to have a look at that fist thing in the morning.
Martin
-
Just noticed it appears the python links library is broken right now. I will try another language.
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 Regarding Moz API token password update
Hi, In March we have updated password for MOZ API and used in our application it worked, but currently the updated password is not working and in the MOZ site the old password is shown and its active. We are using Legacy username and password.
API | | NickAndrews
We see that 5 tokens can be added for API, if we add 2 tokens both will be active.
We are currently using free services. Please help us resolve this issue.0 -
Unsolved Generate an Access ID and API key
Hello, I can't generate an Access ID and API key for my account.
API | | OlegShavilov
I need a Links API and I'm ready to buy a paid subscription, but I can't do it. Link https://moz.com/products/mozscape/access
Redirected to https://moz.com/api/dashboard And i dont see any options for create Access ID0 -
"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 -
Keywords API
Does MOZ offer any statistics/data about keywords through the API? I didn't see anything in the documentation... Thanks! Justin
API | | Campaignium0 -
Lost many links and keyword ranks since moz index update
Hi All, I came back from work today from a week off to find my site has gone from 681 external inbound links to 202. With this my domain authority, moz trust and moz rank have all also taken a slip. Compounding this, I am seeing a slip most of my keywords rankings. If i try to use the open site explorer to explore my links and see what going on i get the message It looks like we haven't discovered link data for this site or URL. If i check the just discovered links like it suggests I get It looks like there's no Just-Discovered Links data for this URL yet. I know these features worked before the index as i used them. Is this all attributable to the moz index issues that have been noted or could something have happened to my site? Since i started 2 months ago I have made many changes including... Updating the site map that was 4 years out of date and included 400 broken urls Removed blank pages and other useless webpages on the site that contained no content (from the previous administrator) Edited a few pages content from keyword spammy stuff to nicely written and relevant content Fixed url rewrites that made loops and un-accessible product pages All these changes should be for the better but the latest readings have me a little worried. Thanks.
API | | ATP0 -
Pulling large amounts of data from moz api
Hi i'm looking to pull large amounts of data from the moz and semrush api. I have been using seotools addon for excel to extract data but excel is slow, sometimes crashes and not very reliable. Can anyone recommend any other tools i can use, to pull huge amounts of data? Any suggestions would be highly appreciated! Cheers, RM
API | | MBASydney0 -
Any idea why HubSpot (which uses the MOZ api) can find our backlinks but OSE can not?
Links are showing up in the HubSpot link tool within a couple of days. OSE has our site showing zero backlinks. ahrefs is finding them too but that makes more sense. Does the API update more frequently than OSE? Any thoughts? Thanks!
API | | KLEANTreatmentCenter0 -
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