I recently needed to find backlink opportunities by comparing our domain with a few competitors. Here's a quick Python script that uses the SERPSpur Backlink Gap Analysis API to identify sites linking to competitors but not to us:
python
import requests
API_KEY = "your_api_key_here"
def find_backlink_gaps(your_domain, competitors):
response = requests.get(
"https://api.serpspur.com/v1/backlink-gap",
headers={"Authorization": f"Bearer {API_KEY}"},
params={"target": your_domain, "competitors": competitors, "limit": 50}
)
data = response.json()
return [link["source"] for link in data.get("gaps", [])]
Example usage
competitors = ["competitor1.com", "competitor2.com"]
gaps = find_backlink_gaps("yoursite.com", competitors)
print("Sites linking to competitors but not you:")
for site in gaps[:10]:
print(f" - {site}")
This uncovered several high-authority domains we hadn't considered for outreach. Have you tried a similar approach for your link-building strategy?
Top comments (3)
Nice work! I've used a similar gap analysis and found it's also a goldmine for discovering niche directories and forums you never knew existed. Curious—how did you prioritize outreach for those high-authority domains?
Great use of backlink gap analysis! I've been doing this manually with Ahrefs, but automating it with an API is much more efficient. Do you also filter by domain authority or relevance before outreach?
I've done something similar, but I found that focusing on the 'why' behind those gaps (like content type or topic authority) helped tailor outreach pitches better. Did you track conversion rates from those identified sites?