Skip to content
    Moz logo Menu open Menu close
    • Products
      • Moz Pro
      • Moz Pro Home
      • Moz Local
      • Moz Local Home
      • STAT
      • Moz API
      • 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.

      Discover Brand Authority
      Moz Pro

      Discover Brand Authority

      Learn More
    • 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.

      What is your Brand Authority?
      Moz

      What is your Brand Authority?

      Take the quiz
    • 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+.

      June 3 & 4, 2024, Seattle
      MozCon

      June 3 & 4, 2024, Seattle

      Get tickets
    • 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.

      Surface actionable competitive intel
      New Feature: Moz Pro

      Surface actionable competitive intel

      Learn More
    • 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
    2481
    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

                • Feipo

                  I can not get the results from API now.

                  Dear master,
                  I can not get the results from API now. And also yesterday. My id is 1393657@qq.com.

                  API | | Feipo
                  2
                • OlegKireyenka

                  API for discovered and lost linking domains

                  Hello, Currently you do not have discovered and lost metrics available via the Links API, maybe there are some workaround to get this metrics? For us, it is very important to use API,  or calculate it some mathematics way. Thank!

                  API | | OlegKireyenka
                  0
                • rogerdavid

                  What is the metric to check link state and link type for MOZ API ?

                  Kindly do not share the website url  related to url and link metrics,instead of mention the correct metric for link state and link type. Thanks!

                  API | | rogerdavid
                  0
                • rogerdavid

                  Is Anchor text metric is available for free MOZ API ?

                  I'm accessing anchor text metric using free MOZ API account which is for 30 days. is there is any way to get anchor text ?

                  API | | rogerdavid
                  0
                • LindsayE

                  Need help understanding API

                  I know what information I need to pull... I know I need APIs to do it... I just don't know how to pull it or where. I have tools like Screaming Frog, Scrapebox, SEMRush, Moz, Majestic, etc. I need to find out how to type in a query and pull the top 10 ranking specs like DA, PA, Root Domains, Word Count, Trust Flow, etc. Here is a screenshot of info I manually pulled... https://screencast.com/t/H1q5XccR8 (I can't hyperlink it... it's giving me an error) How do I auto pull this info?? H1q5XccR8

                  API | | LindsayE
                  0
                • Databox-apps

                  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-apps
                  1
                • Matt.Carwow

                  Moz crawl error? DA & Linking domains significant drop.

                  Hi guys! Our site www.carwow.co.uk appears to have been punched in the face by the latest Moz update. It's claiming our #linking root domains has dropped from 225 to 135 and has subsequently hit our DA from 38 to 35. We haven't disavowed any links and our off-site strategy has been going well the past 2 months. Search performance has increased by around 15% (around 5k sessions) and rankings have improved week on week. Any idea if this is a Moz error? That's almost a 50% drop in linking root domains. Thanks, James

                  API | | Matt.Carwow
                  0
                • csandrew

                  Are EC2 servers blocked from using the Moz API?

                  Hi I've created a script that I'd like to use to check a list of domains using the Moz API. It works totally fine on my local machine. However, when I run it from my EC2 instance, it fails every time. To be specific, the response is always empty (the response is an empty json array) when the request is sent from EC2. Is, for some reason, EC2 blocked by the Moz API? Many thanks for your help, Andrew

                  API | | csandrew
                  0
                Moz logo
                • Contact
                • Community
                • Free Trial
                • Terms & Privacy
                • Accessibility
                • Jobs
                • Help
                • 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.