The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

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

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. API
    4. Can the API Filter Links with Certain Anchor Text?

    Can the API Filter Links with Certain Anchor Text?

    API
    6 4 325
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic 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
      • 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
        • 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
          • 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
            • 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
              • 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
                • 1 / 1
                • First post
                  Last post
                • Can links tracking lists help to crawl high authority backlinks by Moz?
                  Groupespr
                  Groupespr
                  0
                  5
                  130

                • Can the API give the same data as the UI?
                  StevePoul
                  StevePoul
                  1
                  3
                  104

                • What is the metric to check link state and link type for MOZ API ?
                  rogerdavid
                  rogerdavid
                  0
                  3
                  67

                • Where can i find my api key
                  TimHolmes
                  TimHolmes
                  0
                  2
                  1.6k

                • Linking Moz with Excel to compare links enmass
                  Sam.at.Moz
                  Sam.at.Moz
                  0
                  5
                  112

                • API - Internal Links to page and related metrics
                  DavidLee
                  DavidLee
                  1
                  2
                  375

                • Does any one know if there is a tool out there built with the Moz API where you can feed in a large list of URLs and get back Domain Authority?
                  LynnPatchett
                  LynnPatchett
                  0
                  2
                  102

                • Can any of the MOZ APIs give me the top 10 google results for a keyword?
                  jennita
                  jennita
                  0
                  5
                  203

                Get started with Moz Pro!

                Unlock the power of advanced SEO tools and data-driven insights.

                Start my free trial
                Products
                • Moz Pro
                • Moz Local
                • Moz API
                • Moz Data
                • STAT
                • Product Updates
                Moz Solutions
                • SMB Solutions
                • Agency Solutions
                • Enterprise Solutions
                • Digital Marketers
                Free SEO Tools
                • Domain Authority Checker
                • Link Explorer
                • Keyword Explorer
                • Competitive Research
                • Brand Authority Checker
                • Local Citation Checker
                • MozBar Extension
                • MozCast
                Resources
                • Blog
                • SEO Learning Center
                • Help Hub
                • Beginner's Guide to SEO
                • How-to Guides
                • Moz Academy
                • API Docs
                About Moz
                • About
                • Team
                • Careers
                • Contact
                Why Moz
                • Case Studies
                • Testimonials
                Get Involved
                • Become an Affiliate
                • MozCon
                • Webinars
                • Practical Marketer Series
                • MozPod
                Connect with us

                Contact the Help team

                Join our newsletter
                Moz logo
                © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                • Accessibility
                • Terms of Use
                • Privacy