Urgent.News

What's breaking now, across thousands of outlets.

Tech

Fetching Instagram profiles concurrently in Go with HikerAPI

HikerAPI has official clients for Python and Node, but not for Go. I wanted to pull public Instagram profile data (followers, post count, bio) from a Go program, so I wrote a small client using only the standard library. By the end of this post you'll have a CLI that: takes a list of usernames, fetches them concurrently with a bounded worker pool, prints one JSON object per line (ready for jq or…

HikerAPI offers official clients for Python and Node, but lacks a Go client. The author decided to create a Go client to retrieve public Instagram profile data (followers, post count, bio) using only the standard library. A CLI was developed that accepts a list of usernames, fetches them concurrently with a worker pool, and prints JSON objects per line ready for jq or .jsonl files.

A test is included, running against a fake server to avoid spending API credits. To get started, create an account at hikerapi.com and generate an access key. The endpoint used is GET https://api.hikerapi.com/v2/user/by/username?username= with the header x-access-key: your-access-key. The response wraps the profile in a user object, and only the needed fields are decoded, ignoring the rest.

A custom type FlexID handles the user ID (pk) that can appear as a number or string, ensuring proper decoding. A Client struct is defined with a key, base URL, and http.Client for making requests. The UserByUsername method fetches a profile by username, handling potential errors and encoding the response. Two decisions worth noting are setting base as a field for testing and including an empty-username check.

To fetch multiple profiles concurrently, a fixed pool of workers reads from a channel. The client is tested using net/http/httptest, covering real parsing and error handling without network requests.

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

Splitting a dinner bill by who ate what, with the whole bill in the URL

A table of three splits a $96 dinner equally. One of them skipped the cocktails and still pays $32. I wanted a way to split one dinner by who ate what, shared plates included, and to send the result…

  • Three friends used Dollopify to split a $96 dinner bill fairly
  • One friend paid $32 after skipping cocktails, others paid equally
  • Bill was shared via a single HTML file with minified JSON

I Pulled X's 10 Most-Viewed Videos. Nine Were Posted by Accounts You Already Follow.

I Pulled X's 10 Most-Viewed Videos. Nine Were Posted by Accounts You Already Follow. X doesn't hand you a "most viewed videos" leaderboard the way YouTube does, so I pulled public video posts on the…

  • Nine of X's 10 most-viewed videos on Oct 7, 2026, were from accounts users already followed.
  • No celebrities or personal accounts appeared in the top 10 video list.
  • Videos ranked by view count featured exclusive content, familiar context, and existing audiences.

Openreach's optical upgrade: what 800G means for AI data center buyers

Openreach is deploying Ciena Waveserver equipment with WaveLogic 6 coherent technology in its Optical Spectrum Extended Access portfolio.

  • Openreach expands optical network with 800G capacity
  • Deployment includes Ciena's Waveserver and WaveLogic 6 technology
  • Key for AI data center buyers to understand performance specifics

More from Thursday 8 October →