100 free credits. No credit card required. Get a key

Go tutorials for social data

572 step-by-step Go tutorials (net/http and encoding/json): scrape posts, comments, profiles, search results and reviews from 76 platforms with working code and real sample responses.

A first call

Set up with go mod init example, export GROUNDSOCIAL_API_KEY, then:

main.go
package main

import (
	"encoding/json"
	"fmt"
	"log"
	"net/http"
	"os"
	"time"
)

// The fields this program reads, as the recorded response has them.
type Page struct {
	CaptionTracks []struct {
		Name string `json:"name"`
	} `json:"captionTracks"`
}

var client = &http.Client{Timeout: 60 * time.Second}

func fetch() (*Page, error) {
	req, err := http.NewRequest("GET", "https://api.groundsocial.dev/v1/youtube/videos/dQw4w9WgXcQ", nil)
	if err != nil {
		return nil, err
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("GROUNDSOCIAL_API_KEY"))
	res, err := client.Do(req)
	if err != nil {
		return nil, err
	}
	defer res.Body.Close()
	if res.StatusCode != http.StatusOK {
		var e struct {
			Error struct {
				Code      string `json:"code"`
				Hint      string `json:"hint"`
				Retryable bool   `json:"retryable"`
			} `json:"error"`
		}
		json.NewDecoder(res.Body).Decode(&e)
		return nil, fmt.Errorf("%s: %s", e.Error.Code, e.Error.Hint)
	}
	var page Page
	if err := json.NewDecoder(res.Body).Decode(&page); err != nil {
		return nil, err
	}
	return &page, nil
}

func main() {
	page, err := fetch()
	if err != nil {
		log.Fatal(err)
	}
	for _, item := range page.CaptionTracks {
		fmt.Println(item.Name)
	}
}

Reddit

X

Bluesky

Hacker News

Facebook

npm

PyPI

Truth Social

TikTok

Telegram

App Store

YouTube

Pinterest

Steam

Stack Overflow

Polymarket

US Congress trades

SoundCloud

Snapchat

Linktree

Komi

Pillar

Lnk.Bio

Linkme

Finance

Amazon

Google Play

Spotify

Twitch

Kick

Economy

Apple Music

Rumble

Gab

LinkedIn

Walmart

eBay

Cosmos

Target

IKEA

Sephora

Gumtree

Kwai

Best Buy

idealo

H&M

AliExpress

Weibo

Douyin

Xiaohongshu

Instagram

Yelp

Tripadvisor

Threads

Trustpilot

G2

Airbnb

GitHub

Zillow

Booking.com

Jobs

Redfin

Goodreads

Realtor.com

Apple Maps

Google

Google News

Web

Wikipedia

Bing

DuckDuckGo

Baidu

Google Trends

On-page SEO

Utility

Creator tools

Prism composites

Content analysis