Help us shape the future of Go! Take the 2026 Go Developer Survey

seobserver

package
v0.12.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APICallMeta

type APICallMeta struct {
	Endpoint     string
	Method       string
	StatusCode   uint16
	DurationMs   uint32
	ResponseBody string // truncated to 10KB
}

APICallMeta captures metadata about an API call for logging.

type Anchor

type Anchor struct {
	AnchorText    string `json:"anchor"`
	BacklinkCount int64  `json:"backlinks"`
	RefDomains    int64  `json:"refdomains"`
}
type Backlink struct {
	SourceURL      string  `json:"source_url"`
	TargetURL      string  `json:"target_url"`
	AnchorText     string  `json:"anchor"`
	SourceDomain   string  `json:"source_domain"`
	LinkType       string  `json:"type"`
	TrustFlow      float64 `json:"trust_flow"`
	CitationFlow   float64 `json:"citation_flow"`
	SourceTTFTopic string  `json:"source_ttf_topic"`
	Nofollow       bool    `json:"nofollow"`
	FirstSeen      string  `json:"first_seen"`
	LastSeen       string  `json:"last_seen"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is an HTTP client for the SEObserver API.

func NewClient

func NewClient(apiKey, appVersion string) *Client

NewClient creates a new SEObserver API client.

func (*Client) FetchAnchors

func (c *Client) FetchAnchors(ctx context.Context, domain string, limit int) ([]Anchor, *APICallMeta, error)

FetchAnchors fetches anchor text distribution via backlinks/anchors.json.

func (c *Client) FetchBacklinks(ctx context.Context, domain string, limit int) ([]Backlink, *APICallMeta, error)

FetchBacklinks fetches top backlinks via backlinks/top.json.

func (*Client) FetchRankings

func (c *Client) FetchRankings(ctx context.Context, domain, base string, limit, offset int) ([]Ranking, *APICallMeta, error)

FetchRankings fetches organic keyword rankings via organic_keywords/index.json.

func (*Client) FetchRefDomains

func (c *Client) FetchRefDomains(ctx context.Context, domain string, limit int) ([]RefDomain, *APICallMeta, error)

FetchRefDomains fetches referring domains via backlinks/refdomains.json.

func (*Client) FetchTopPages

func (c *Client) FetchTopPages(ctx context.Context, domain string, limit int) ([]TopPage, *APICallMeta, error)

FetchTopPages fetches top pages with Majestic authority data via backlinks/pages.json.

func (*Client) FetchVisibilityHistory

func (c *Client) FetchVisibilityHistory(ctx context.Context, domain, base string) ([]VisibilityPoint, *APICallMeta, error)

FetchVisibilityHistory fetches organic visibility history.

func (*Client) GetDomainMetrics

func (c *Client) GetDomainMetrics(ctx context.Context, domain string) (*DomainMetrics, *APICallMeta, error)

GetDomainMetrics fetches domain-level metrics via backlinks/metrics.json.

type DomainMetrics

type DomainMetrics struct {
	BacklinksTotal  int64   `json:"backlinks"`
	RefDomainsTotal int64   `json:"refdomains"`
	DomainRank      float64 `json:"domain_rank"`
	OrganicKeywords int64   `json:"organic_keywords"`
	OrganicTraffic  int64   `json:"organic_traffic"`
	OrganicCost     float64 `json:"organic_cost"`
}

type Ranking

type Ranking struct {
	Keyword      string  `json:"keyword"`
	Position     uint16  `json:"position"`
	URL          string  `json:"url"`
	SearchVolume int64   `json:"search_volume"`
	CPC          float64 `json:"cpc"`
	Traffic      float64 `json:"traffic"`
	TrafficPct   float64 `json:"traffic_pct"`
}

type RefDomain

type RefDomain struct {
	Domain        string  `json:"domain"`
	BacklinkCount int64   `json:"backlinks"`
	DomainRank    float64 `json:"domain_rank"`
	FirstSeen     string  `json:"first_seen"`
	LastSeen      string  `json:"last_seen"`
}

type TopPage

type TopPage struct {
	URL              string      `json:"url"`
	Title            string      `json:"title"`
	TrustFlow        uint8       `json:"trust_flow"`
	CitationFlow     uint8       `json:"citation_flow"`
	ExtBackLinks     int64       `json:"ext_backlinks"`
	RefDomains       int64       `json:"ref_domains"`
	OutLinks         int64       `json:"out_links"`
	TopicalTrustFlow []TopicalTF `json:"topical_trust_flow"`
	Language         string      `json:"language"`
	LastCrawlResult  string      `json:"last_crawl_result"`
	LastCrawlDate    string      `json:"last_crawl_date"`
}

TopPage represents a top page with Majestic authority metrics.

func ParseRawTopPage added in v0.6.0

func ParseRawTopPage(raw map[string]interface{}) TopPage

ParseRawTopPage parses a single raw top page from the flexible API response. The API returns mixed types: TTF values can be int or empty string, OutLinks is a string.

type TopicalTF

type TopicalTF struct {
	Topic string `json:"topic"`
	Value uint8  `json:"value"`
}

TopicalTF represents a topical trust flow entry.

type VisibilityPoint

type VisibilityPoint struct {
	Date          string  `json:"date"`
	Visibility    float64 `json:"visibility"`
	KeywordsCount int64   `json:"keywords_count"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL