Skip to content
    Moz logo Menu open Menu close
    • Products
      • Moz Pro
      • Moz Pro Home
      • Moz Local
      • Moz Local Home
      • STAT
      • Moz API
      • Moz API Home
      • Compare SEO Products
      • Moz Data
    • Free SEO Tools
      • Domain Analysis
      • Keyword Explorer
      • Link Explorer
      • Competitive Research
      • MozBar
      • More Free SEO Tools
    • Learn SEO
      • Beginner's Guide to SEO
      • SEO Learning Center
      • Moz Academy
      • SEO Q&A
      • Webinars, Whitepapers, & Guides
    • Blog
    • Why Moz
      • Agency Solutions
      • Enterprise Solutions
      • Small Business Solutions
      • Case Studies
      • The Moz Story
      • New Releases
    • Log in
    • Log out
    • Products
      • Moz Pro

        Your all-in-one suite of SEO essentials.

      • Moz Local

        Raise your local SEO visibility with complete local SEO management.

      • STAT

        SERP tracking and analytics for enterprise SEO experts.

      • Moz API

        Power your SEO with our index of over 44 trillion links.

      • Compare SEO Products

        See which Moz SEO solution best meets your business needs.

      • Moz Data

        Power your SEO strategy & AI models with custom data solutions.

      Save big on Moz Pro!
      Limited time offer

      Save big on Moz Pro!

      See pricing
    • Free SEO Tools
      • Domain Analysis

        Get top competitive SEO metrics like DA, top pages and more.

      • Keyword Explorer

        Find traffic-driving keywords with our 1.25 billion+ keyword index.

      • Link Explorer

        Explore over 40 trillion links for powerful backlink data.

      • Competitive Research

        Uncover valuable insights on your organic search competitors.

      • MozBar

        See top SEO metrics for free as you browse the web.

      • More Free SEO Tools

        Explore all the free SEO tools Moz has to offer.

      Access the Moz API for less
      Save on Moz Data

      Access the Moz API for less

      Hurry - ends Dec 6th!
    • Learn SEO
      • Beginner's Guide to SEO

        The #1 most popular introduction to SEO, trusted by millions.

      • SEO Learning Center

        Broaden your knowledge with SEO resources for all skill levels.

      • On-Demand Webinars

        Learn modern SEO best practices from industry experts.

      • How-To Guides

        Step-by-step guides to search success from the authority on SEO.

      • Moz Academy

        Upskill and get certified with on-demand courses & certifications.

      • SEO Q&A

        Insights & discussions from an SEO community of 500,000+.

      Save 20% on all Moz Academy courses
      Limited time offer

      Save 20% on all Moz Academy courses

      Level up your SEO
    • Blog
    • Why Moz
      • Small Business Solutions

        Uncover insights to make smarter marketing decisions in less time.

      • Agency Solutions

        Earn & keep valuable clients with unparalleled data & insights.

      • Enterprise Solutions

        Gain a competitive edge in the ever-changing world of search.

      • The Moz Story

        Moz was the first & remains the most trusted SEO company.

      • Case Studies

        Explore how Moz drives ROI with a proven track record of success.

      • New Releases

        Get the scoop on the latest and greatest from Moz.

      Explore Moz updates & save up to 40%
      Big Savings!

      Explore Moz updates & save up to 40%

      See the latest
    • Log in
      • Moz Pro
      • Moz Local
      • Moz Local Dashboard
      • Moz API
      • Moz API Dashboard
      • Moz Academy
    • Avatar
      • Moz Home
      • Notifications
      • Account & Billing
      • Manage Users
      • Community Profile
      • My Q&A
      • My Videos
      • Log Out

    The Moz Q&A Forum

    • Forum
    • Questions
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. Home
    2. Moz Tools
    3. API
    4. Can the API Filter Links with Certain Anchor Text?

    Can the API Filter Links with Certain Anchor Text?

    API
    4
    6
    2657
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with question management privileges can see it.
    • nbyloff
      nbyloff last edited by

      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'

      1 Reply Last reply Reply Quote 0
      • Jgfbjvvnnvvvb
        Jgfbjvvnnvvvb last edited by

        Is there a chance to use Moz API in Python? According to the pricing of Moz maybe it is free?

        1 Reply Last reply Reply Quote 0
        • nbyloff
          nbyloff last edited by

          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!

          1 Reply Last reply Reply Quote 0
          • BrandonF
            BrandonF last edited by

            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.

            1 Reply Last reply Reply Quote 2
            • LokiAstari
              LokiAstari last edited by

              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

              1 Reply Last reply Reply Quote 1
              • nbyloff
                nbyloff last edited by

                Just noticed it appears the python links library is broken right now. I will try another language.

                1 Reply Last reply Reply Quote 1
                • 1 / 1
                • First post
                  Last post

                Got a burning SEO question?

                Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.


                Start my free trial


                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.

                • See all categories

                Related Questions

                • Skys

                  Unsolved MOZ API for domain authority

                  api da

                  I am using the MOZ API to check domain authority (DA). Recently, I noticed a discrepancy: the DA value retrieved via the API differs from the result on the MOZ homepage. Specifically, the API returns a DA of 10, while the homepage shows "NO DATA." Additionally, other services like Ahrefs report a DA of 0. I relied on the MOZ API's result when purchasing this domain and now feel misled. I would like to understand the exact reason for this inconsistency.

                  API | | Skys
                  0
                • adrianTNT

                  Unsolved How to get Domain Authority using API ?

                  api domain authority

                  I wanted to test the API and while looking on the documentation urls, I cannot find details on how to get Domain Authority. is that not available to query ? was it replaced by Brand Authority ? is it only available for the paid API or for the free one too ? I looked at many documentation pages but I find it very confusing and frustrating, there are many versions of the documentation and various URLs and not clearly labeled, I understand some are V1, V2, V3, etc, but I didn't find sample API calls for Domain Authority. Thank you.

                  API | | adrianTNT
                  0
                • MinnieCarnahan

                  How many domain i can do bulk check using API ?

                  hi i want to know how many domain i can bulk check to get url-metric API?

                  API | | MinnieCarnahan
                  0
                • yuca.pro

                  Location Data Batch Updates via the MOZ API

                  According to the MOZ API documentation, I am able to update multiple Locations in a batch in order to create or update their location data, currently 130 locations. I have successfully created a batch and the API returned the $id, as I expected. Yet, it doesn't make clear how the multiple locations I want to update are supposed to be sent back to the API. I was expecting an upload of a CSV file or JSON data, and not Query Parameter as noted in the docs. When including a JSON file, properly formatted, as a binary upload, the response is still expecting a locations parameter. See error here: {     "status":"MISSING_PARAMETER",     "message":"locations missing. ",     "response": {          "locations":"MISSING_PARAMETER"                                }     } https://moz.com/developers/docs/local/api#_api_batch__id-PATCH

                  API | | yuca.pro
                  1
                • maxfun0007

                  How to cost is calculated in Moz API for fetching only backlinks

                  I am unable to understand which particular API  used to get the backlinks. And how cost is calculated. Suppose I Hit the API one time it gave me 100 backlinks of a particular domain. Does that mean i used 100 rows?

                  API | | maxfun0007
                  0
                • thomas.deruiter

                  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.deruiter
                  0
                • pollierer

                  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=..
                  &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 Pollierer

                  API | | pollierer
                  1
                • amchapel

                  Can any of the MOZ APIs give me the top 10 google results for a keyword?

                  I'd like to feed a list of keywords into the Moz API and get back a list of the websites that appear on the first page for that keyword. Can anyone tell me if this is possible?

                  API | | amchapel
                  0
                Moz logo
                • Contact
                • Community
                • Free Trial
                • Terms & Privacy
                • Accessibility
                • Jobs
                • Help
                • What's New
                • News & Press
                • MozCon
                © 2021 - 2024 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.

                Looks like your connection to Moz was lost, please wait while we try to reconnect.