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
-
Unknown data items in Links API response
So I'm on the documentation page at https://moz.com/help/links-api/making-calls/url-metrics . I've copied the bit fields table into a spreadsheet. I've removed all the "deprecated" items and have totalled up the remaining items making a Cols= value of 182537205900657000. For want of better knowledge, I've used that same value for LinkCols=, SourceCols= and TargetCols=. The request url ends up being (anonymized): http://lsapi.seomoz.com/linkscape/links/fordanddoonan.com.au?Cols=182537205900657000&AccessID=xxx&Expires=1557458487346&Signature=xxx&SourceCols=182537205900657000&TargetCols=182537205900657000&LinkCols=182537205900657000&Limit=1000&Scope=page_to_domain&Filter=external My question is, what do I make of all the extra fields that I get in the json packet what should I do to remove them? These extra fields are: lrid, lsrc, ltgt, luufq, luueid, lufeid, luujid, luumrp, luumrr, luflan, lufspf, lufsplc, lufspp, lufsps, lufspsc, luus, lufuid, lupuid, lufipl, luupa, lupda, luued, lufed, luped, lupib, luulc, flan, fspf, fsplc, fspp, fsps Is it simply a case of limiting the values of TargetCols, LinkCols and SourceCols? If so, to what?
API | | StevePoul1 -
Can the API give the same data as the UI?
What I mean is, I'm not that interested in counts. What I'd like to figure out is how to get the API to give me what the UI gives me , so that for a given target domain I can download a report with the following fields: URL
API | | StevePoul
Title
Anchor Text
Spam Score
PA
DA
Linking Domains to Page
Target URL
Link Type
Link State
Date First Seen
Date Last Seen
Date Lost
HTTP Status Code
Links to Page
Outbound Domains from Page
Outbound Links from Page
Operator profile That's essentially the same as a CSV report generated by clicking on the "Export CSV" button. I could ,I suppose, get someone to write something in Selenium to enter a domain, click on the button and hang around on the notifications page for the results but I'd really rather not.1 -
MOZ API - metadata permission error
Hi there, I have a small issue using MOZ API. I cannot make successful GET request for metadata (index stats). The request looks like this: http://lsapi.seomoz.com/linkscape/metadata/index_stats?AccessID=mozscape-XXXXXX&Expires=1497442682&Signature=XXXXXX. In my most recent request, I got an error message: "Permission denied: pckgmhkomakbnflgmckhobiiojjmomjpph". Did I forget something? Signed Authentication should be OK, because it works with other endpoints, such as "url-metrics", "links" etc. Thanks in advance! Kind regards, Zoran
API | | Databox-apps1 -
The difference between api value and screen value
When I check the two parameters (PA and DA values) actually, these values often differ from those which I receive from your API. Why does it happen?
API | | orange0021 -
Is it possible to send a string/id to an api call and return it?
I am integrating your mozscape API into a project of mine and I am in need of seeing if I can send and return a variable with an associated call. For instance when I am sending some batch URL's I am requesting the [upa] and [pda] back. I am also requesting the [uu] (canonical URL) but it always seems to come back blank. So the issue I am having is if I send a batch of urls to the API how do I know how to associate a [upa] or [pda] with a link? My thoughts are if I could send a ID with a link and return that ID back then I know how to associate the [upa] or [pda] with that particular link. Anyone know?
API | | cbielich1 -
Does on-page grader have an API ?
Hi, I would very much like to include the on-page grader output into my SEO tools. Is there an API for that? thanks James
API | | KMdayJob0