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 Can I get Moz keywords via API?
Hi, my boss is asking if you "have any API for keyword research -- e.g., as soon as a user creates a card title in [our application], we can auto-recommend keywords from Moz within [the application]. I shared a link with him to your Links API page, but he says he doesn't think that API does the above. Can you help? Thank you, Renae
API | | CarolinaRen0 -
How to remove bad or spammy links from Moz?
My website has gotten some bad and spammy links. I know how to disavow bad links from Google. But I reviewed Moz and haven't got any disavow option.
API | | juanitajb9
Have any disavow option on Moz? How can I remove the bad links from Moz? Thanks0 -
MOZ API - Search Visibility
Hello there, We are looking to see if we can recreate the Search Visibility report through the API. We are wondering which API parameters and metrics we should use to recreate the report? Also, we want to distinguish between traffic coming from desktops and mobile traffic. Is this possible with the API? Which type of account do we need to use for these functionalities: the free account or paid account? We are currently using a free account. Also: we are wondering if can access historical data with the API? For instance: we want to determine the domain authority from October 2016 off on. Is this possible? Thanks in advance! Kind regards, Bart Minten
API | | thomas.deruiter0 -
API Access Change
I'm not sure, but I seem to remember that there was a certain number of API calls that USED to be included with my MOZ Pro level subscription and as I check it now, the API access is a separate subscription. Was there a recent change or has my memory finally started going?
API | | SWGroves0 -
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 -
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 -
API - Internal Links to page and related metrics
Hi dear moz Team! Currently I´m building a Java application accessing your API. But there are some metrics I urgently need which I can´t get out of the API until now: The total number of internal links to a page The total number of internal links to a page with partial anchor text match MozRank passed by all internal links w. part. match anchor text (would be nice) For example, if I try this by your links endpoint, my idea was: http://lsapi.seomoz.com/linkscape/links/http%3A%2F%2Fwww.jetztspielen.de%2F?AccessID=..
API | | pollierer
&Expires=..
&Signature=..
&Scope=domain_to_page
&Filter=internal
&Sort=domain_authority
&SourceCols=4 (or any other value)
&SourceDomain=www.jetztspielen.de
&Offset=0
&Limit=50 If I try this, the API says: {"status": "400", "error_message": "Cannot set a source domain when filtering for internal links."} Is there any way to get the data I need by your API endpoints? I´m currently writing my master thesis and it is very important to me to solve this somehow. Thank you very much in advance! Best, Andreas Pollierer1