How do I collect all links through the SEOMoz API?
-
How do I collect all links through the SEOMoz API?
Yes, I know how to pull url metrics info but want to pull the inbound links only via php script w/out having to go to the OSE page to pull.
any suggestions would be great!
-
hey got it workin, I sent u a private message with a Q for a sort.
cheers!
-
No problem, feel free to send me a private message if you need help with the code.
-
thanks Casey, let me have a run and let you know.
cheers!
-
Please check out the authentication wiki page: http://apiwiki.seomoz.org/w/page/29574176/SignedAuthentication
$objectURL = $domain_url;$accessID = "member-XXXXXXXXXXX";
$secretKey = "XXXXXXXXXXXXXXX";
$expires = mktime() + 300;
// The request is good for the next 5 minutes, or 300 seconds from now.
$stringToSign = $accessID."\n".$expires;
// Get the "raw" or binary output of the hmac hash.
$binarySignature = hash_hmac('sha1', $stringToSign, $secretKey, true);
// We need to base64-encode it and then url-encode that.
$urlSafeSignature = urlencode(base64_encode($binarySignature));
// You don't have to use fopen and can't in some scenarios. CURL is a better choice for production.
$handle = fopen($urlToFetch, "r");$links_contents = ''; while (!feof($handle)) { $links_contents .= fread($handle, 8192);} fclose($handle);
echo $links_contents;
?>
Here is how we are pulling it in. Replace $accessID with your API code, you can sort and filter through the different link calls. Replace "Limit" with however much you want to pull in. The code will return a json response, from there you can parse the data however you want.
I hope that helps!
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
-
Why did my DA and Links go down?
How could I begin to research this to find out why we have less total links and a lower domain authority. Our DA has gone down two points and our total links dropped by a few thousand. I'd like to find out why that happened but I'm just not sure where to start. Thanks!
Moz Pro | | Sika220 -
SEOMoz On-Page Report Card
This question is for one of the SEOMoz staff. With the ongoing changes and improvement in algorithms, does the SEOMoz team keep the "On-page Report Card" up to date with best practices?
Moz Pro | | tdawson090 -
SEOmoz ranking report SERP
I was wondering how SEOmoz the SERPs tracks? e.g. the SERP of keyword in the Google US report, doesn't give me the same result as https://www.google.com/search?pws=0&gl=us&q=keyword Does SEOmoz check the google.com SERPs from several locations and calculate an average?
Moz Pro | | Teklan0 -
How often do SEOmoz update the PA?
How often do SEOmoz index backlinks? I have got the same amount of backlinks now for nearly a month. Thanks!
Moz Pro | | SWK0 -
Why am I still Unranked in SEOmoz?
I was very active in SEOmoz's Q&A forums today and completed my profile - raising my Moz points from 0 to 50. On my profile, however, I am still listed as Unranked. Also, I do not appear on the SEOmoz Top Members List next to other users with 50 points. I'm guessing this is something that is updated once a day or so, and the rank will update tomorrow. Is my suspicion correct?
Moz Pro | | AnthonyMangia0 -
HUGE LINK!PR9 Not showing up
Hi ,My site is ranking very well.Although lacking large numbers of links ,Im only able to grasp the bottom page of First Page, Im in the position #6 through Position #10 with approximately 44 keywords. Its been about a year now so i think im doing well .. ** Here is my problem,** I recently was able to pick up a few very good High ranking backlinks ,They are in the Range of pr8 & 9 they have huge amounts of links pointing to them,One of them is a Dot Edu back link..Niether one of these are showing up..In fact , In the open site explorer i had a couple very high domain rank backlinks showing as my top link. This been there for 7 months They are gone...Now i have these 2 new backlinks both pr8 and pr9 not showing up in the top of the list..They are both cached .I can see them in the cached links .. ** But where the heck is my new links ??? been about 1-2 months ..shoudnt these show up in the top of open site exploreer?? Very aggrevating...Could this be open site explorer reading the site differently month after month??**
Moz Pro | | herrie0 -
Why would PA be 1 (0 links from 0 root domains) if it's linked to internally?
Question just about said it all: I've seen a number of pages on sites that have a PA of 1 (with the metrics being 0 links from 0 root domains) when I can see on the site that it is linked to internally - from the main nav (which is CSS, not Javascript) and also from the footer, if not other places. Why would this be? Update: upon looking further at the site, it appears that there's some kind of redirect going on, where the page linked to from the nav actually redirects to the real page. Would that eliminate PA, even if it's a 301? And additionally, is whatever is causing this lack of PA a reflection of how Google would relate to the page? Thanks, Aviva
Moz Pro | | debi_zyx0