google

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 12 Imported by: 0

README

Google clients for Crawlora

Official Crawlora client packages for the hosted Google API. These clients call Crawlora's hosted API; they do not scrape Google locally. Requests use your Crawlora account and CRAWLORA_API_KEY; service usage follows your account billing plan. Crawlora is independent from and not affiliated with or endorsed by Google or its owners.

Language packages

For installation and runnable examples, use the README for your language. See the API endpoint and parameter reference for shared operation details.

Create an account at crawlora.net, open the Crawlora console to get an API key, or read the API documentation. Keep CRAWLORA_API_KEY out of source control.

API coverage

The six clients provide access to 40 public API operations. See the API reference for supported operations, parameters, and response details.

License

MIT. See LICENSE.

Documentation

Overview

Package google is a focused Go client for Crawlora's Google endpoints. API documentation: https://crawlora.net/docs?utm_source=pkg.go.dev&utm_medium=referral&utm_campaign=platform-clients&utm_content=google-go-api-docs

Index

Examples

Constants

View Source
const (
	DefaultBaseURL = "https://api.crawlora.net/api/v1"
	Version        = "0.1.0"
)
View Source
const OperationCount = 40

OperationCount reports how many selected-platform operations this module exposes.

Variables

This section is empty.

Functions

func OperationIDs

func OperationIDs() []string

OperationIDs returns the selected operation IDs in stable sorted order.

Types

type Client

type Client struct {
	APIKey     string
	BaseURL    string
	Timeout    time.Duration
	HTTPClient *http.Client
}

Client calls only the operation IDs included in this platform module.

func NewClient

func NewClient(apiKey string) *Client

NewClient creates a client using the supplied API key, or CRAWLORA_API_KEY when empty.

func (*Client) Call

func (c *Client) Call(ctx context.Context, operationID string, params Params) (any, error)

Call executes a selected platform operation by operation ID.

Example
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
	w.Header().Set("Content-Type", "application/json")
	_, _ = w.Write([]byte(`{"ok":true}`))
}))
defer server.Close()

client := NewClient("your-crawlora-api-key")
client.BaseURL = server.URL + "/api/v1"
client.HTTPClient = server.Client()
result, err := client.Call(context.Background(), "google-finance-analyst-articles", Params{"quote": "sample-id"})
if err != nil {
	panic(err)
}
fmt.Println(result.(map[string]any)["ok"])
Output:
true

func (*Client) Close

func (c *Client) Close() error

Close releases idle connections held by the configured HTTP transport.

func (*Client) FinanceAnalystArticles

func (c *Client) FinanceAnalystArticles(ctx context.Context, params Params) (any, error)

FinanceAnalystArticles calls the google-finance-analyst-articles operation.

func (*Client) FinanceChart

func (c *Client) FinanceChart(ctx context.Context, params Params) (any, error)

FinanceChart calls the google-finance-chart operation.

func (*Client) FinanceClassification

func (c *Client) FinanceClassification(ctx context.Context, params Params) (any, error)

FinanceClassification calls the google-finance-classification operation.

func (*Client) FinanceCompany

func (c *Client) FinanceCompany(ctx context.Context, params Params) (any, error)

FinanceCompany calls the google-finance-company operation.

func (*Client) FinanceContext

func (c *Client) FinanceContext(ctx context.Context, params Params) (any, error)

FinanceContext calls the google-finance-context operation.

func (*Client) FinanceFinancials

func (c *Client) FinanceFinancials(ctx context.Context, params Params) (any, error)

FinanceFinancials calls the google-finance-financials operation.

func (*Client) FinanceMarketsCategoryNews

func (c *Client) FinanceMarketsCategoryNews(ctx context.Context, params Params) (any, error)

FinanceMarketsCategoryNews calls the google-finance-markets-category-news operation.

func (*Client) FinanceMarketsCategoryStocks

func (c *Client) FinanceMarketsCategoryStocks(ctx context.Context, params Params) (any, error)

FinanceMarketsCategoryStocks calls the google-finance-markets-category-stocks operation.

func (*Client) FinanceMarketsEarnings

func (c *Client) FinanceMarketsEarnings(ctx context.Context, params Params) (any, error)

FinanceMarketsEarnings calls the google-finance-markets-earnings operation.

func (*Client) FinanceMarketsFeatured

func (c *Client) FinanceMarketsFeatured(ctx context.Context, params Params) (any, error)

FinanceMarketsFeatured calls the google-finance-markets-featured operation.

func (*Client) FinanceMarketsHeadline

func (c *Client) FinanceMarketsHeadline(ctx context.Context, params Params) (any, error)

FinanceMarketsHeadline calls the google-finance-markets-headline operation.

func (*Client) FinanceMarketsIndices

func (c *Client) FinanceMarketsIndices(ctx context.Context, params Params) (any, error)

FinanceMarketsIndices calls the google-finance-markets-indices operation.

func (*Client) FinanceMarketsMovers

func (c *Client) FinanceMarketsMovers(ctx context.Context, params Params) (any, error)

FinanceMarketsMovers calls the google-finance-markets-movers operation.

func (*Client) FinanceMarketsTop

func (c *Client) FinanceMarketsTop(ctx context.Context, params Params) (any, error)

FinanceMarketsTop calls the google-finance-markets-top operation.

func (*Client) FinanceMarketsTrending

func (c *Client) FinanceMarketsTrending(ctx context.Context, params Params) (any, error)

FinanceMarketsTrending calls the google-finance-markets-trending operation.

func (*Client) FinanceNews

func (c *Client) FinanceNews(ctx context.Context, params Params) (any, error)

FinanceNews calls the google-finance-news operation.

func (*Client) FinanceQuote

func (c *Client) FinanceQuote(ctx context.Context, params Params) (any, error)

FinanceQuote calls the google-finance-quote operation.

func (*Client) FinanceRelated

func (c *Client) FinanceRelated(ctx context.Context, params Params) (any, error)

FinanceRelated calls the google-finance-related operation.

func (*Client) FinanceSearch

func (c *Client) FinanceSearch(ctx context.Context, params Params) (any, error)

FinanceSearch calls the google-finance-search operation.

func (*Client) FinanceTicker

func (c *Client) FinanceTicker(ctx context.Context, params Params) (any, error)

FinanceTicker calls the google-finance-ticker operation.

func (*Client) Jobs

func (c *Client) Jobs(ctx context.Context, params Params) (any, error)

Jobs calls the google-jobs operation.

func (*Client) MapPlace

func (c *Client) MapPlace(ctx context.Context, params Params) (any, error)

MapPlace calls the google-map-place operation.

func (*Client) MapPlacePhotos

func (c *Client) MapPlacePhotos(ctx context.Context, params Params) (any, error)

MapPlacePhotos calls the google-map-place-photos operation.

func (*Client) MapPlaceReviews

func (c *Client) MapPlaceReviews(ctx context.Context, params Params) (any, error)

MapPlaceReviews calls the google-map-place-reviews operation.

func (*Client) MapSearch

func (c *Client) MapSearch(ctx context.Context, params Params) (any, error)

MapSearch calls the google-map-search operation.

func (*Client) News

func (c *Client) News(ctx context.Context, params Params) (any, error)

News calls the google-news operation.

func (*Client) NewsSearch

func (c *Client) NewsSearch(ctx context.Context, params Params) (any, error)

NewsSearch calls the google-news-search operation.

func (*Client) Suggest

func (c *Client) Suggest(ctx context.Context, params Params) (any, error)

Suggest calls the google-suggest operation.

func (*Client) TrendsCategories

func (c *Client) TrendsCategories(ctx context.Context, params Params) (any, error)

TrendsCategories calls the google-trends-categories operation.

func (*Client) TrendsEnums

func (c *Client) TrendsEnums(ctx context.Context, params Params) (any, error)

TrendsEnums calls the google-trends-enums operation.

func (*Client) TrendsExplore

func (c *Client) TrendsExplore(ctx context.Context, params Params) (any, error)

TrendsExplore calls the google-trends-explore operation.

func (*Client) TrendsExploreInterestByRegion

func (c *Client) TrendsExploreInterestByRegion(ctx context.Context, params Params) (any, error)

TrendsExploreInterestByRegion calls the google-trends-explore-interest-by-region operation.

func (*Client) TrendsExploreInterestOverTime

func (c *Client) TrendsExploreInterestOverTime(ctx context.Context, params Params) (any, error)

TrendsExploreInterestOverTime calls the google-trends-explore-interest-over-time operation.

func (*Client) TrendsExploreRelatedTopics

func (c *Client) TrendsExploreRelatedTopics(ctx context.Context, params Params) (any, error)

TrendsExploreRelatedTopics calls the google-trends-explore-related-topics operation.

func (*Client) TrendsExploreRisingQueries

func (c *Client) TrendsExploreRisingQueries(ctx context.Context, params Params) (any, error)

TrendsExploreRisingQueries calls the google-trends-explore-rising-queries operation.

func (*Client) TrendsExploreTopQueries

func (c *Client) TrendsExploreTopQueries(ctx context.Context, params Params) (any, error)

TrendsExploreTopQueries calls the google-trends-explore-top-queries operation.

func (*Client) TrendsLocations

func (c *Client) TrendsLocations(ctx context.Context, params Params) (any, error)

TrendsLocations calls the google-trends-locations operation.

func (*Client) TrendsTrending

func (c *Client) TrendsTrending(ctx context.Context, params Params) (any, error)

TrendsTrending calls the google-trends-trending operation.

func (*Client) TrendsTrendingDetail

func (c *Client) TrendsTrendingDetail(ctx context.Context, params Params) (any, error)

TrendsTrendingDetail calls the google-trends-trending-detail operation.

func (*Client) Videos

func (c *Client) Videos(ctx context.Context, params Params) (any, error)

Videos calls the google-videos operation.

type Params

type Params map[string]any

Params maps the exact OpenAPI parameter names expected by this platform client.

Jump to

Keyboard shortcuts

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