Documentation
¶
Overview ¶
Package crawlsnap is the official Go client for the CrawlSnap data intelligence platform.
client, err := crawlsnap.NewClient("sk-cs-...") // or set CRAWLSNAP_API_KEY
if err != nil { log.Fatal(err) }
ip, err := client.VectorSnap.IP(ctx, "8.8.8.8")
if err != nil { log.Fatal(err) }
fmt.Println(ip.GetReputation(), ip.GetAsOwner())
Every call returns the unwrapped, typed payload on success and a typed error otherwise (see errors.go) — the caller never inspects the response envelope.
Package crawlsnap — error types.
Hierarchy (mirrors the other CrawlSnap SDKs):
CrawlSnapError marker interface for everything the SDK returns
├── ConfigError misconfiguration (e.g. missing API key)
├── DecodeError a 2xx body could not be decoded
├── APIConnectionError transport failed (no HTTP response)
│ └── APITimeoutError the request timed out
└── APIStatusError the API returned a non-success status
├── BadRequestError 400 invalid input
├── AuthenticationError 401 missing / invalid API key
├── QuotaExceededError 402 out of credits / monthly quota
├── SubscriptionInactiveError 403 subscription not active
├── NotFoundError 404 no data for the indicator
├── RateLimitError 429 request limit exceeded
└── ServerError 5xx server / upstream failure
Discover the concrete type with errors.As:
if _, err := client.VectorSnap.IP(ctx, "8.8.8.8"); err != nil {
var nf *crawlsnap.NotFoundError
if errors.As(err, &nf) { /* no data for this indicator */ }
var status *crawlsnap.APIStatusError // catches any HTTP status error
if errors.As(err, &status) { log.Println(status.StatusCode, status.RequestID) }
var any crawlsnap.CrawlSnapError // catches anything the SDK returns
if errors.As(err, &any) { /* ... */ }
}
Index ¶
- Constants
- Variables
- type APIConnectionError
- type APIStatusError
- type APITimeoutError
- type AllTeamsData
- type AuthenticationError
- type BadRequestError
- type ChannelInfoData
- type ChannelRepeatsData
- type ChannelsData
- type Client
- type CompetitionDetailData
- type CompetitionTablesData
- type CompetitionTvRightsData
- type CompetitionTwitterData
- type CompetitionsData
- type ConfigError
- type CrawlSnapError
- type DecodeError
- type IocDomainScanData
- type IocHashScanData
- type IocIPScanData
- type IocURLScanData
- type LivescoresData
- type MatchData
- type MatchesData
- type NewsDetailData
- type NewsListData
- type NotFoundError
- type Option
- type PlayerData
- type PopularTeamsData
- type PulseDomainScanData
- type PulseHashScanData
- type PulseIPScanData
- type PulseSnap
- func (r *PulseSnap) Domain(ctx context.Context, query string, opts ...RequestOption) (models.PulseDomainScanData, error)
- func (r *PulseSnap) Hash(ctx context.Context, query string, opts ...RequestOption) (models.PulseHashScanData, error)
- func (r *PulseSnap) IP(ctx context.Context, query string, opts ...RequestOption) (models.PulseIpScanData, error)
- func (r *PulseSnap) URL(ctx context.Context, query string, opts ...RequestOption) (models.PulseUrlScanData, error)
- func (r *PulseSnap) V1() *PulseSnap
- type PulseURLScanData
- type QuotaExceededError
- type RateLimitError
- type RawResponse
- type RequestOption
- type SearchData
- type ServerError
- type SportSnap
- func (r *SportSnap) AllChannels(ctx context.Context, isoCode string, opts ...RequestOption) (models.ChannelsData, error)
- func (r *SportSnap) AllTeams(ctx context.Context, opts ...RequestOption) (models.AllTeamsData, error)
- func (r *SportSnap) ChannelInfo(ctx context.Context, slug, isoCode string, opts ...RequestOption) (models.ChannelInfoData, error)
- func (r *SportSnap) ChannelRepeats(ctx context.Context, slug, isoCode string, opts ...RequestOption) (models.ChannelRepeatsData, error)
- func (r *SportSnap) Channels(ctx context.Context, isoCode string, opts ...RequestOption) (models.ChannelsData, error)
- func (r *SportSnap) ClubTeam(ctx context.Context, country, team string, opts ...RequestOption) (models.TeamDetailData, error)
- func (r *SportSnap) ClubTeamNews(ctx context.Context, country, team string, start int, opts ...RequestOption) (models.NewsListData, error)
- func (r *SportSnap) Competition(ctx context.Context, country, slug string, opts ...RequestOption) (models.CompetitionDetailData, error)
- func (r *SportSnap) CompetitionNews(ctx context.Context, country, slug string, start int, opts ...RequestOption) (models.NewsListData, error)
- func (r *SportSnap) CompetitionTables(ctx context.Context, country, slug string, opts ...RequestOption) (models.CompetitionTablesData, error)
- func (r *SportSnap) CompetitionTvRights(ctx context.Context, country, slug string, opts ...RequestOption) (models.CompetitionTvRightsData, error)
- func (r *SportSnap) CompetitionTwitter(ctx context.Context, country, slug string, opts ...RequestOption) (models.CompetitionTwitterData, error)
- func (r *SportSnap) Competitions(ctx context.Context, isoCode string, opts ...RequestOption) (models.CompetitionsData, error)
- func (r *SportSnap) Livescores(ctx context.Context, opts ...RequestOption) (models.LivescoresData, error)
- func (r *SportSnap) Match(ctx context.Context, id int64, opts ...RequestOption) (models.MatchData, error)
- func (r *SportSnap) MatchChannels(ctx context.Context, id int64, isoCode string, opts ...RequestOption) (models.MatchData, error)
- func (r *SportSnap) MatchCommentaries(ctx context.Context, id int64, opts ...RequestOption) (models.MatchData, error)
- func (r *SportSnap) MatchExtended(ctx context.Context, id int64, opts ...RequestOption) (models.MatchData, error)
- func (r *SportSnap) MatchExtraBroadcasts(ctx context.Context, id int64, opts ...RequestOption) (models.MatchData, error)
- func (r *SportSnap) MatchStats(ctx context.Context, id int64, opts ...RequestOption) (models.MatchData, error)
- func (r *SportSnap) Matches(ctx context.Context, isoCode string, opts ...RequestOption) (models.MatchesData, error)
- func (r *SportSnap) MatchesExtended(ctx context.Context, isoCode string, timestamp int64, opts ...RequestOption) (models.MatchesData, error)
- func (r *SportSnap) NationalTeam(ctx context.Context, slug string, opts ...RequestOption) (models.TeamDetailData, error)
- func (r *SportSnap) NationalTeamNews(ctx context.Context, slug string, start int, opts ...RequestOption) (models.NewsListData, error)
- func (r *SportSnap) News(ctx context.Context, start int, isoCode string, opts ...RequestOption) (models.NewsListData, error)
- func (r *SportSnap) NewsArticle(ctx context.Context, id int64, opts ...RequestOption) (models.NewsDetailData, error)
- func (r *SportSnap) NewsByTag(ctx context.Context, tag string, start int, opts ...RequestOption) (models.NewsListData, error)
- func (r *SportSnap) Player(ctx context.Context, slug string, id int64, opts ...RequestOption) (models.PlayerData, error)
- func (r *SportSnap) PopularSearches(ctx context.Context, opts ...RequestOption) (models.SearchData, error)
- func (r *SportSnap) PopularTeams(ctx context.Context, opts ...RequestOption) (models.PopularTeamsData, error)
- func (r *SportSnap) SearchAll(ctx context.Context, query string, opts ...RequestOption) (models.SearchData, error)
- func (r *SportSnap) SearchCompetitions(ctx context.Context, query string, opts ...RequestOption) (models.SearchData, error)
- func (r *SportSnap) SearchMatches(ctx context.Context, query string, opts ...RequestOption) (models.SearchData, error)
- func (r *SportSnap) SearchPlayers(ctx context.Context, query string, opts ...RequestOption) (models.SearchData, error)
- func (r *SportSnap) SearchTeams(ctx context.Context, query string, opts ...RequestOption) (models.SearchData, error)
- func (r *SportSnap) V1() *SportSnap
- type SubdoSnap
- func (r *SubdoSnap) Scan(ctx context.Context, query string, opts ...RequestOption) (models.SubdoSnapScanData, error)
- func (r *SubdoSnap) ScanIter(ctx context.Context, query string) iter.Seq2[map[string]any, error]
- func (r *SubdoSnap) ScanWithCursor(ctx context.Context, query, cursor string, opts ...RequestOption) (models.SubdoSnapScanData, error)
- func (r *SubdoSnap) V1() *SubdoSnap
- type SubdoSnapScanData
- type SubscriptionInactiveError
- type TeamDetailData
- type VectorSnap
- func (r *VectorSnap) Domain(ctx context.Context, query string, opts ...RequestOption) (models.IocDomainScanData, error)
- func (r *VectorSnap) Hash(ctx context.Context, query string, opts ...RequestOption) (models.IocHashScanData, error)
- func (r *VectorSnap) IP(ctx context.Context, query string, opts ...RequestOption) (models.IocIpScanData, error)
- func (r *VectorSnap) URL(ctx context.Context, query string, opts ...RequestOption) (models.IocUrlScanData, error)
- func (r *VectorSnap) V1() *VectorSnap
Constants ¶
const ( DefaultBaseURL = "https://api.crawlsnap.com" DefaultTimeout = 30 * time.Second DefaultMaxRetries = 2 )
Defaults for client configuration.
const DefaultVersion = "v1"
DefaultVersion is the stable, per-release default API version used by unpinned calls. It does not move on its own: upgrading the SDK never silently retargets your calls at a newer API version. Promoting a product's default to a new version is a deliberate, changelogged release change.
Pin a single product to a specific version with its version accessor (e.g. VectorSnap.V1()) — this affects only that product, leaving the others on their own defaults.
const Version = "0.5.0"
Version is the SDK release version, sent in the User-Agent header.
Variables ¶
var ErrNoAPIKey = &ConfigError{Message: "no API key provided: pass it to NewClient or set CRAWLSNAP_API_KEY"}
ErrNoAPIKey is returned by NewClient when no API key is supplied and CRAWLSNAP_API_KEY is unset.
Functions ¶
This section is empty.
Types ¶
type APIConnectionError ¶
APIConnectionError is returned when the request never reached the API (DNS, connection refused, TLS, ...). Unwrap to inspect the underlying cause.
func (*APIConnectionError) As ¶
func (e *APIConnectionError) As(target any) bool
As lets errors.As extract the embedded *APIConnectionError from *APITimeoutError.
func (*APIConnectionError) Error ¶
func (e *APIConnectionError) Error() string
func (*APIConnectionError) Unwrap ¶
func (e *APIConnectionError) Unwrap() error
type APIStatusError ¶
type APIStatusError struct {
// StatusCode is the effective HTTP status (the body response_code when it
// disagrees with and supersedes the transport status).
StatusCode int
// Message is the human-readable error from the response envelope.
Message string
// RequestID is the x-request-id response header, useful for support.
RequestID string
// Body is the raw response body (the BaseResponse envelope), when available.
Body []byte
}
APIStatusError is the base error for any non-success HTTP status. The seven status-specific types embed it; errors.As(err, &(*APIStatusError)(nil)) on any of them yields this base value.
func (*APIStatusError) As ¶
func (e *APIStatusError) As(target any) bool
As lets errors.As extract the embedded *APIStatusError from any of the status-specific subtypes (they embed APIStatusError and promote this method).
func (*APIStatusError) Error ¶
func (e *APIStatusError) Error() string
type APITimeoutError ¶
type APITimeoutError struct {
*APIConnectionError
}
APITimeoutError is returned when the request timed out. It embeds *APIConnectionError, so it is also matched by errors.As as a connection error.
type AllTeamsData ¶ added in v0.5.0
type AllTeamsData = models.AllTeamsData
Convenience aliases for the typed response payloads, so callers can refer to them without importing the models package directly. The canonical definitions (generated from the OpenAPI contract) live in package models.
type AuthenticationError ¶
type AuthenticationError struct{ APIStatusError }
AuthenticationError is returned for HTTP 401 (missing / invalid API key).
type BadRequestError ¶
type BadRequestError struct{ APIStatusError }
BadRequestError is returned for HTTP 400 (invalid indicator).
type ChannelInfoData ¶ added in v0.5.0
type ChannelInfoData = models.ChannelInfoData
Convenience aliases for the typed response payloads, so callers can refer to them without importing the models package directly. The canonical definitions (generated from the OpenAPI contract) live in package models.
type ChannelRepeatsData ¶ added in v0.5.0
type ChannelRepeatsData = models.ChannelRepeatsData
Convenience aliases for the typed response payloads, so callers can refer to them without importing the models package directly. The canonical definitions (generated from the OpenAPI contract) live in package models.
type ChannelsData ¶ added in v0.5.0
type ChannelsData = models.ChannelsData
Convenience aliases for the typed response payloads, so callers can refer to them without importing the models package directly. The canonical definitions (generated from the OpenAPI contract) live in package models.
type Client ¶
type Client struct {
// Resource groups.
VectorSnap *VectorSnap
PulseSnap *PulseSnap
SubdoSnap *SubdoSnap
SportSnap *SportSnap
// contains filtered or unexported fields
}
Client is the CrawlSnap API client. It is safe for concurrent use.
type CompetitionDetailData ¶ added in v0.5.0
type CompetitionDetailData = models.CompetitionDetailData
Convenience aliases for the typed response payloads, so callers can refer to them without importing the models package directly. The canonical definitions (generated from the OpenAPI contract) live in package models.
type CompetitionTablesData ¶ added in v0.5.0
type CompetitionTablesData = models.CompetitionTablesData
Convenience aliases for the typed response payloads, so callers can refer to them without importing the models package directly. The canonical definitions (generated from the OpenAPI contract) live in package models.
type CompetitionTvRightsData ¶ added in v0.5.0
type CompetitionTvRightsData = models.CompetitionTvRightsData
Convenience aliases for the typed response payloads, so callers can refer to them without importing the models package directly. The canonical definitions (generated from the OpenAPI contract) live in package models.
type CompetitionTwitterData ¶ added in v0.5.0
type CompetitionTwitterData = models.CompetitionTwitterData
Convenience aliases for the typed response payloads, so callers can refer to them without importing the models package directly. The canonical definitions (generated from the OpenAPI contract) live in package models.
type CompetitionsData ¶ added in v0.5.0
type CompetitionsData = models.CompetitionsData
Convenience aliases for the typed response payloads, so callers can refer to them without importing the models package directly. The canonical definitions (generated from the OpenAPI contract) live in package models.
type ConfigError ¶
type ConfigError struct{ Message string }
ConfigError is returned for SDK misconfiguration detected before any request is made (e.g. a missing API key). It is a config-time error, distinct from the transport-level APIConnectionError.
func (*ConfigError) Error ¶
func (e *ConfigError) Error() string
type CrawlSnapError ¶
type CrawlSnapError interface {
error
// contains filtered or unexported methods
}
CrawlSnapError is implemented by every error the SDK returns. Use it with errors.As to catch anything originating from this package.
type DecodeError ¶
DecodeError is returned when a successful (2xx) response body could not be decoded into the expected typed payload — an application-layer failure, not a transport one.
func (*DecodeError) Error ¶
func (e *DecodeError) Error() string
func (*DecodeError) Unwrap ¶
func (e *DecodeError) Unwrap() error
type IocDomainScanData ¶
type IocDomainScanData = models.IocDomainScanData
Convenience aliases for the typed response payloads, so callers can refer to them without importing the models package directly. The canonical definitions (generated from the OpenAPI contract) live in package models.
type IocHashScanData ¶
type IocHashScanData = models.IocHashScanData
Convenience aliases for the typed response payloads, so callers can refer to them without importing the models package directly. The canonical definitions (generated from the OpenAPI contract) live in package models.
type IocIPScanData ¶
type IocIPScanData = models.IocIpScanData
Convenience aliases for the typed response payloads, so callers can refer to them without importing the models package directly. The canonical definitions (generated from the OpenAPI contract) live in package models.
type IocURLScanData ¶
type IocURLScanData = models.IocUrlScanData
Convenience aliases for the typed response payloads, so callers can refer to them without importing the models package directly. The canonical definitions (generated from the OpenAPI contract) live in package models.
type LivescoresData ¶ added in v0.5.0
type LivescoresData = models.LivescoresData
SportSnap payloads.
type MatchData ¶ added in v0.5.0
Convenience aliases for the typed response payloads, so callers can refer to them without importing the models package directly. The canonical definitions (generated from the OpenAPI contract) live in package models.
type MatchesData ¶ added in v0.5.0
type MatchesData = models.MatchesData
Convenience aliases for the typed response payloads, so callers can refer to them without importing the models package directly. The canonical definitions (generated from the OpenAPI contract) live in package models.
type NewsDetailData ¶ added in v0.5.0
type NewsDetailData = models.NewsDetailData
Convenience aliases for the typed response payloads, so callers can refer to them without importing the models package directly. The canonical definitions (generated from the OpenAPI contract) live in package models.
type NewsListData ¶ added in v0.5.0
type NewsListData = models.NewsListData
Convenience aliases for the typed response payloads, so callers can refer to them without importing the models package directly. The canonical definitions (generated from the OpenAPI contract) live in package models.
type NotFoundError ¶
type NotFoundError struct{ APIStatusError }
NotFoundError is returned for HTTP 404 (no data for the supplied indicator).
type Option ¶
type Option func(*clientConfig)
Option configures a Client in NewClient.
func WithBaseURL ¶
WithBaseURL overrides the API host (default https://api.crawlsnap.com, or $CRAWLSNAP_BASE_URL).
func WithHTTPClient ¶
WithHTTPClient supplies your own *http.Client (advanced). Takes precedence over WithTimeout and WithTransport.
func WithMaxRetries ¶
WithMaxRetries sets retries for 429 / 5xx / connection errors (default 2).
func WithTimeout ¶
WithTimeout sets the per-request timeout (default 30s). Ignored when WithHTTPClient is supplied.
func WithTransport ¶
func WithTransport(rt http.RoundTripper) Option
WithTransport supplies a custom http.RoundTripper, e.g. a mock for testing.
type PlayerData ¶ added in v0.5.0
type PlayerData = models.PlayerData
Convenience aliases for the typed response payloads, so callers can refer to them without importing the models package directly. The canonical definitions (generated from the OpenAPI contract) live in package models.
type PopularTeamsData ¶ added in v0.5.0
type PopularTeamsData = models.PopularTeamsData
Convenience aliases for the typed response payloads, so callers can refer to them without importing the models package directly. The canonical definitions (generated from the OpenAPI contract) live in package models.
type PulseDomainScanData ¶
type PulseDomainScanData = models.PulseDomainScanData
Convenience aliases for the typed response payloads, so callers can refer to them without importing the models package directly. The canonical definitions (generated from the OpenAPI contract) live in package models.
type PulseHashScanData ¶
type PulseHashScanData = models.PulseHashScanData
Convenience aliases for the typed response payloads, so callers can refer to them without importing the models package directly. The canonical definitions (generated from the OpenAPI contract) live in package models.
type PulseIPScanData ¶
type PulseIPScanData = models.PulseIpScanData
Convenience aliases for the typed response payloads, so callers can refer to them without importing the models package directly. The canonical definitions (generated from the OpenAPI contract) live in package models.
type PulseSnap ¶
type PulseSnap struct {
// contains filtered or unexported fields
}
PulseSnap is the threat-intelligence pulse enrichment resource. A direct call uses the stable default API version; pin explicitly with V1().
func (*PulseSnap) Domain ¶
func (r *PulseSnap) Domain(ctx context.Context, query string, opts ...RequestOption) (models.PulseDomainScanData, error)
Domain returns pulse enrichment for a domain.
func (*PulseSnap) Hash ¶
func (r *PulseSnap) Hash(ctx context.Context, query string, opts ...RequestOption) (models.PulseHashScanData, error)
Hash returns pulse enrichment for a file hash.
func (*PulseSnap) IP ¶
func (r *PulseSnap) IP(ctx context.Context, query string, opts ...RequestOption) (models.PulseIpScanData, error)
IP returns pulse enrichment for an IP address.
func (*PulseSnap) URL ¶
func (r *PulseSnap) URL(ctx context.Context, query string, opts ...RequestOption) (models.PulseUrlScanData, error)
URL returns pulse enrichment for a URL.
type PulseURLScanData ¶
type PulseURLScanData = models.PulseUrlScanData
Convenience aliases for the typed response payloads, so callers can refer to them without importing the models package directly. The canonical definitions (generated from the OpenAPI contract) live in package models.
type QuotaExceededError ¶
type QuotaExceededError struct{ APIStatusError }
QuotaExceededError is returned for HTTP 402 (out of credits or monthly quota).
type RateLimitError ¶
type RateLimitError struct {
APIStatusError
// RetryAfter is the Retry-After header value in seconds, if the server sent one.
RetryAfter float64
}
RateLimitError is returned for HTTP 429 (request limit exceeded).
type RawResponse ¶
type RawResponse struct {
StatusCode int
IsSuccess bool
Data any
Message string
ResponseCode *int
RequestID string
Headers http.Header
}
RawResponse is the full envelope, populated when a call is made with WithRawResponse. Data holds the parsed typed payload.
type RequestOption ¶
type RequestOption func(*requestConfig)
RequestOption customizes a single request.
func WithRawResponse ¶
func WithRawResponse(dst *RawResponse) RequestOption
WithRawResponse populates dst with the full response envelope (status, headers, request id, is_success, message) alongside the normal typed return.
type SearchData ¶ added in v0.5.0
type SearchData = models.SearchData
Convenience aliases for the typed response payloads, so callers can refer to them without importing the models package directly. The canonical definitions (generated from the OpenAPI contract) live in package models.
type ServerError ¶
type ServerError struct{ APIStatusError }
ServerError is returned for HTTP 5xx (server or upstream failure).
type SportSnap ¶ added in v0.3.0
type SportSnap struct {
// contains filtered or unexported fields
}
SportSnap is the football data resource. It exposes the full source surface: live scores with in-match events, fixture lists, single-match views (detail, stats, commentary, broadcasts), competition catalog and detail (fixtures, standings, top scorers, TV rights), national and club teams, TV channel directories and schedules, a news feed, full-text search across every entity type, and player profiles. A direct call uses the stable default API version; pin explicitly with V1().
Path segments (competition country/slug, team country/team, player slug/id) come from the `url` fields in list, search, and detail payloads. iso_code is a two-letter region code that resolves region-specific broadcast channels; pass "" to use the server default.
func (*SportSnap) AllChannels ¶ added in v0.5.0
func (r *SportSnap) AllChannels(ctx context.Context, isoCode string, opts ...RequestOption) (models.ChannelsData, error)
AllChannels returns the full TV channel catalog for the iso_code region.
func (*SportSnap) AllTeams ¶ added in v0.5.0
func (r *SportSnap) AllTeams(ctx context.Context, opts ...RequestOption) (models.AllTeamsData, error)
AllTeams returns the full national-team catalog: per-country men's and women's team names with the slugs used by NationalTeam.
func (*SportSnap) ChannelInfo ¶ added in v0.5.0
func (r *SportSnap) ChannelInfo(ctx context.Context, slug, isoCode string, opts ...RequestOption) (models.ChannelInfoData, error)
ChannelInfo returns channel metadata (name, platform, website, coverage) and the channel's broadcast rights for a channel slug.
func (*SportSnap) ChannelRepeats ¶ added in v0.5.0
func (r *SportSnap) ChannelRepeats(ctx context.Context, slug, isoCode string, opts ...RequestOption) (models.ChannelRepeatsData, error)
ChannelRepeats returns the channel's repeat/upcoming broadcast schedule with paging cursors. An empty fixtures array is a valid result, not an error.
func (*SportSnap) Channels ¶ added in v0.5.0
func (r *SportSnap) Channels(ctx context.Context, isoCode string, opts ...RequestOption) (models.ChannelsData, error)
Channels returns the curated (football-relevant) channel list for the iso_code region.
func (*SportSnap) ClubTeam ¶ added in v0.5.0
func (r *SportSnap) ClubTeam(ctx context.Context, country, team string, opts ...RequestOption) (models.TeamDetailData, error)
ClubTeam returns the club view (profile, squad, competitions, fixtures). country/team come from team url values in other payloads (e.g. spain/barcelona).
func (*SportSnap) ClubTeamNews ¶ added in v0.5.0
func (r *SportSnap) ClubTeamNews(ctx context.Context, country, team string, start int, opts ...RequestOption) (models.NewsListData, error)
ClubTeamNews returns news about a club team, paginated via start.
func (*SportSnap) Competition ¶ added in v0.5.0
func (r *SportSnap) Competition(ctx context.Context, country, slug string, opts ...RequestOption) (models.CompetitionDetailData, error)
Competition returns the competition detail: fixtures around the current date, standings, top scorers, and broadcast-rights holders. country/slug come from competition_url values in other payloads.
func (*SportSnap) CompetitionNews ¶ added in v0.5.0
func (r *SportSnap) CompetitionNews(ctx context.Context, country, slug string, start int, opts ...RequestOption) (models.NewsListData, error)
CompetitionNews returns news about a competition, paginated via start.
func (*SportSnap) CompetitionTables ¶ added in v0.5.0
func (r *SportSnap) CompetitionTables(ctx context.Context, country, slug string, opts ...RequestOption) (models.CompetitionTablesData, error)
CompetitionTables returns the competition standings, grouped by stage.
func (*SportSnap) CompetitionTvRights ¶ added in v0.5.0
func (r *SportSnap) CompetitionTvRights(ctx context.Context, country, slug string, opts ...RequestOption) (models.CompetitionTvRightsData, error)
CompetitionTvRights returns the channels holding broadcast rights for the competition.
func (*SportSnap) CompetitionTwitter ¶ added in v0.5.0
func (r *SportSnap) CompetitionTwitter(ctx context.Context, country, slug string, opts ...RequestOption) (models.CompetitionTwitterData, error)
CompetitionTwitter returns social feed items for the competition (often empty).
func (*SportSnap) Competitions ¶ added in v0.5.0
func (r *SportSnap) Competitions(ctx context.Context, isoCode string, opts ...RequestOption) (models.CompetitionsData, error)
Competitions returns the competition catalog: popular competitions, domestic leagues grouped by country, international club competitions, and tournaments.
func (*SportSnap) Livescores ¶ added in v0.5.0
func (r *SportSnap) Livescores(ctx context.Context, opts ...RequestOption) (models.LivescoresData, error)
Livescores returns the live-score board for every tracked competition: score line, match status, and structured in-match events.
func (*SportSnap) Match ¶ added in v0.3.0
func (r *SportSnap) Match(ctx context.Context, id int64, opts ...RequestOption) (models.MatchData, error)
Match returns the full match view keyed by the numeric match id (fixture_id from fixture lists, live scores, or search): teams, kickoff, venue, lineups, structured events, statistics, and broadcast channels.
func (*SportSnap) MatchChannels ¶ added in v0.5.0
func (r *SportSnap) MatchChannels(ctx context.Context, id int64, isoCode string, opts ...RequestOption) (models.MatchData, error)
MatchChannels returns the match view with broadcast channels resolved for the requested iso_code region.
func (*SportSnap) MatchCommentaries ¶ added in v0.5.0
func (r *SportSnap) MatchCommentaries(ctx context.Context, id int64, opts ...RequestOption) (models.MatchData, error)
MatchCommentaries returns the match view with the structured event feed populated when the source provides it.
func (*SportSnap) MatchExtended ¶ added in v0.5.0
func (r *SportSnap) MatchExtended(ctx context.Context, id int64, opts ...RequestOption) (models.MatchData, error)
MatchExtended is the extended match view: it adds *_translations maps for the competition and team names.
func (*SportSnap) MatchExtraBroadcasts ¶ added in v0.5.0
func (r *SportSnap) MatchExtraBroadcasts(ctx context.Context, id int64, opts ...RequestOption) (models.MatchData, error)
MatchExtraBroadcasts returns the extended match view carrying additional broadcast options (repeats, on-demand listings).
func (*SportSnap) MatchStats ¶ added in v0.5.0
func (r *SportSnap) MatchStats(ctx context.Context, id int64, opts ...RequestOption) (models.MatchData, error)
MatchStats returns the match view with statistics fields populated when the source provides them.
func (*SportSnap) Matches ¶ added in v0.5.0
func (r *SportSnap) Matches(ctx context.Context, isoCode string, opts ...RequestOption) (models.MatchesData, error)
Matches returns upcoming/current fixtures grouped by competition, with the broadcast channels available in the requested iso_code region. Pass "" for the server-default region.
func (*SportSnap) MatchesExtended ¶ added in v0.5.0
func (r *SportSnap) MatchesExtended(ctx context.Context, isoCode string, timestamp int64, opts ...RequestOption) (models.MatchesData, error)
MatchesExtended is the extended fixture list: it adds per-locale team-name translations and omits per-fixture channels. timestamp is a unix-second watermark for incremental fetches (0 returns everything).
func (*SportSnap) NationalTeam ¶ added in v0.5.0
func (r *SportSnap) NationalTeam(ctx context.Context, slug string, opts ...RequestOption) (models.TeamDetailData, error)
NationalTeam returns the national-team view (profile, squad, competitions, fixtures) for a country slug.
func (*SportSnap) NationalTeamNews ¶ added in v0.5.0
func (r *SportSnap) NationalTeamNews(ctx context.Context, slug string, start int, opts ...RequestOption) (models.NewsListData, error)
NationalTeamNews returns news about a national team, paginated via start.
func (*SportSnap) News ¶ added in v0.5.0
func (r *SportSnap) News(ctx context.Context, start int, isoCode string, opts ...RequestOption) (models.NewsListData, error)
News returns the news feed, paginated via start (0 for the first page), for the iso_code region.
func (*SportSnap) NewsArticle ¶ added in v0.5.0
func (r *SportSnap) NewsArticle(ctx context.Context, id int64, opts ...RequestOption) (models.NewsDetailData, error)
NewsArticle returns a single article (body HTML, tags, byline) plus related articles.
func (*SportSnap) NewsByTag ¶ added in v0.5.0
func (r *SportSnap) NewsByTag(ctx context.Context, tag string, start int, opts ...RequestOption) (models.NewsListData, error)
NewsByTag returns news carrying the given tag (e.g. "messi", "world-cup"), paginated via start.
func (*SportSnap) Player ¶ added in v0.5.0
func (r *SportSnap) Player(ctx context.Context, slug string, id int64, opts ...RequestOption) (models.PlayerData, error)
Player returns the player profile, current team, and per-season statistics. The slug/id pair comes from player url values in search results, lineups, and squads.
func (*SportSnap) PopularSearches ¶ added in v0.5.0
func (r *SportSnap) PopularSearches(ctx context.Context, opts ...RequestOption) (models.SearchData, error)
PopularSearches returns the currently popular search results.
func (*SportSnap) PopularTeams ¶ added in v0.5.0
func (r *SportSnap) PopularTeams(ctx context.Context, opts ...RequestOption) (models.PopularTeamsData, error)
PopularTeams returns the popular-teams list.
func (*SportSnap) SearchAll ¶ added in v0.5.0
func (r *SportSnap) SearchAll(ctx context.Context, query string, opts ...RequestOption) (models.SearchData, error)
SearchAll runs full-text search across teams, competitions, matches, and players. Result url values feed the corresponding endpoints of this API.
func (*SportSnap) SearchCompetitions ¶ added in v0.5.0
func (r *SportSnap) SearchCompetitions(ctx context.Context, query string, opts ...RequestOption) (models.SearchData, error)
SearchCompetitions runs full-text search over competitions.
func (*SportSnap) SearchMatches ¶ added in v0.5.0
func (r *SportSnap) SearchMatches(ctx context.Context, query string, opts ...RequestOption) (models.SearchData, error)
SearchMatches runs full-text search over matches.
func (*SportSnap) SearchPlayers ¶ added in v0.5.0
func (r *SportSnap) SearchPlayers(ctx context.Context, query string, opts ...RequestOption) (models.SearchData, error)
SearchPlayers runs full-text search over players. Result url values carry the slug/id segments used by Player.
func (*SportSnap) SearchTeams ¶ added in v0.5.0
func (r *SportSnap) SearchTeams(ctx context.Context, query string, opts ...RequestOption) (models.SearchData, error)
SearchTeams runs full-text search over teams.
type SubdoSnap ¶
type SubdoSnap struct {
// contains filtered or unexported fields
}
SubdoSnap is the subdomain enumeration resource. A direct call uses the stable default API version; pin explicitly with V1().
func (*SubdoSnap) Scan ¶
func (r *SubdoSnap) Scan(ctx context.Context, query string, opts ...RequestOption) (models.SubdoSnapScanData, error)
Scan fetches the first page of subdomains for a domain. Use the returned Cursor with ScanWithCursor to page manually, or ScanIter to stream every subdomain automatically.
func (*SubdoSnap) ScanIter ¶
ScanIter streams every subdomain across all pages, following the cursor for you. Range over it with Go 1.23+ range-over-func:
for sub, err := range client.SubdoSnap.ScanIter(ctx, "example.com") {
if err != nil { return err }
fmt.Println(sub["subdomain"])
}
Iteration stops at the first error (yielded once with a nil subdomain) or when the cursor is exhausted.
func (*SubdoSnap) ScanWithCursor ¶
func (r *SubdoSnap) ScanWithCursor(ctx context.Context, query, cursor string, opts ...RequestOption) (models.SubdoSnapScanData, error)
ScanWithCursor fetches one page of subdomains starting at the given cursor.
type SubdoSnapScanData ¶
type SubdoSnapScanData = models.SubdoSnapScanData
Convenience aliases for the typed response payloads, so callers can refer to them without importing the models package directly. The canonical definitions (generated from the OpenAPI contract) live in package models.
type SubscriptionInactiveError ¶
type SubscriptionInactiveError struct{ APIStatusError }
SubscriptionInactiveError is returned for HTTP 403 (subscription not active).
type TeamDetailData ¶ added in v0.5.0
type TeamDetailData = models.TeamDetailData
Convenience aliases for the typed response payloads, so callers can refer to them without importing the models package directly. The canonical definitions (generated from the OpenAPI contract) live in package models.
type VectorSnap ¶
type VectorSnap struct {
// contains filtered or unexported fields
}
VectorSnap is the IoC reputation enrichment resource. A direct call uses the stable default API version; pin explicitly with V1().
func (*VectorSnap) Domain ¶
func (r *VectorSnap) Domain(ctx context.Context, query string, opts ...RequestOption) (models.IocDomainScanData, error)
Domain returns reputation enrichment for a domain.
func (*VectorSnap) Hash ¶
func (r *VectorSnap) Hash(ctx context.Context, query string, opts ...RequestOption) (models.IocHashScanData, error)
Hash returns reputation enrichment for a file hash.
func (*VectorSnap) IP ¶
func (r *VectorSnap) IP(ctx context.Context, query string, opts ...RequestOption) (models.IocIpScanData, error)
IP returns reputation enrichment for an IP address.
func (*VectorSnap) URL ¶
func (r *VectorSnap) URL(ctx context.Context, query string, opts ...RequestOption) (models.IocUrlScanData, error)
URL returns reputation enrichment for a URL.
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
quickstart
command
Command quickstart demonstrates the CrawlSnap Go SDK.
|
Command quickstart demonstrates the CrawlSnap Go SDK. |