DEV Community

Saraswat Bhowmik
Saraswat Bhowmik

Posted on

hikerapi

Last month, my hashtag tracking script finally died. I had been running a headless browser setup to check public profiles in my niche and see which tags correlated with higher engagement, and Instagram’s login walls and rate-limit blocks brought the whole pipeline to a halt. Spending weekends rotating proxies and fixing broken selectors wasn't helping me analyze content performance.

I needed a reliable way to pull profile metrics and post metadata without maintaining fragile scraping infrastructure, so I switched to a REST API approach using HikerAPI.

Why an API Beats Custom Scraping
Using a dedicated REST endpoint eliminates the constant maintenance of headless browsers, proxy rotation, and DOM changes—you just send a standard HTTP request and get structured JSON back.

Pulling Profile Data in Python
To figure out which hashtags are actually working in a given niche, the first step is pulling baseline profile data (like follower counts and media totals) for accounts in that space so you can normalize their engagement rates.

You only need the standard requests library to get started. First, install it if you haven't already:

Bash
pip install requests
Next, grab your API key from HikerAPI (they include 100 free requests to test things out, and pricing starts at $0.001 per request after that).

Here is the exact snippet to fetch a user's profile object by their username:

Python
import requests

headers = {"x-access-key": "YOUR_KEY"}
r = requests.get(
"https://api.hikerapi.com/v2/user/by/username",
params={"username": "spotify"},
headers=headers,
)
print(r.json())
Replace "YOUR_KEY" with your actual access key and swap "spotify" for any public handle in your niche.

How I Use This for Hashtag Analysis
Once the JSON response comes back, I extract the user's pk (user ID) and follower_count. From there, I pass that ID into the media endpoints to pull recent posts, extract the hashtag arrays from the captions, and calculate engagement relative to their follower size.

Instead of guessing which tags are saturated or dead, I can quickly cross-reference which specific hashtags appear on posts that outperform an account's baseline reach—all in a lightweight Python script that actually stays online.

Top comments (0)