Urgent.News

What's breaking now, across thousands of outlets.

Tech

Resolving an Instagram handle during an OSINT lookup, in four lines of Python

A list of handles lands in my queue. Half are typos, dead accounts, or impersonations of the account I actually care about. Before I open a single browser tab I want three things: does the handle resolve, what is the numeric ID behind it, and how big is it. * The call * import requests headers = {"x-access-key": "YOUR_KEY"} resp = requests.get( " https://api.hikerapi.com/v2/user/by/username ",…

A list of Instagram handles is processed in a queue. Many of these handles are invalid, do not exist, or are imitations of the desired account. Before opening any browser tabs, three key pieces of information are sought: whether the handle resolves, the numeric ID associated with it, and the size of the account. The Python script uses the HikerAPI to make a single request to an Instagram endpoint, passing the handle as a parameter.

The two essential fields extracted from the API response are the user's numeric ID (pk) and follower count. The pk remains constant even if the handle changes, providing a stable identifier for the account over time. The follower count helps prioritize the accounts based on their popularity. Two errors that may occur during the process are a 402 status code, indicating an empty prepaid balance, and a 429 status code, signaling that the request rate is too high and needs to be slowed down.

The script separates these two error types to handle them appropriately. The script also handles cases where private or new accounts may not return the follower count field, avoiding a KeyError. Using the HikerAPI is more efficient and reliable than scraping the Instagram website directly, as the latter no longer renders profile data for logged-out visitors, resulting in heavy and empty HTML that is difficult to parse.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Is Investing in eCommerce Website Development Actually Worth It?

You can have great products, competitive prices, and plenty of visitors, yet still lose sales because your online store is slow, confusing, difficult to use on mobile, or frustrating at checkout.

  • eCommerce website development costs vary based on design, integrations, features, and maintenance.
  • Improving checkout UX can significantly boost conversion rates and ROI for businesses.

Why Your Database Isn't Slow. Your Cache Is Missing

If you've ever wondered why every backend system you read about has a cache sitting somewhere in the architecture diagram, this is the "why" behind it, explained the way I actually understood it, not…

  • Repeated reads from database are wasteful
  • Caching reduces database load by serving frequent requests
  • TTL prevents caches from serving outdated information

Post-Quantum Crypto Meets a Non-Extractable TPM Key

Post-Quantum Crypto Meets a Non-Extractable TPM Key An engineering story about combining two useful properties without pretending either one solves the whole problem.

  • Post-quantum ML-KEM with 768-bit security level added to P-256 key
  • ML-KEM decapsulation and ECDH operation combined via hybrid KDF
  • TPM retains P-256 private scalar, ML-KEM key generated independently

More from Friday 25 September →