diff --git a/README.md b/README.md index 9c181b9..8d803b9 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ See the [playground](https://serpapi.com/playground) to generate your own code. ```golang func main() { - // Initialize the client with custom setting + // Initialize the client with custom settings setting := serpapi.NewSerpApiClientSetting("") // Replace with your SerpApi key setting.Persistent = false // Enable persistent search setting.Asynchronous = true // Enable asynchronous search @@ -60,7 +60,7 @@ func main() { "device": "desktop", } - // formated search results as a map + //formatted search results as a map // serpapi.com converts HTML -> JSON rsp, err := client.Search(parameter) @@ -69,8 +69,8 @@ func main() { } fmt.Println(rsp) - // raw search engine html as a String - // serpapi.com acts a proxy to provive high throughputs, no search limit and more. + // raw search engine HTML as a String + // serpapi.com acts as a proxy to provide high throughput, no search limit, and more. raw_html, err := client.Html(parameter) if err != nil { panic(err) @@ -80,7 +80,7 @@ func main() { ``` [Google search documentation](https://serpapi.com/search-api). -More hands on examples are available below. +More hands-on examples are available below. #### Documentations @@ -118,9 +118,9 @@ It prints the first 5 locations matching Austin (Texas, Texas, Rochester) This API allows retrieving previous search results. To fetch earlier results from the search_id. -First, you need to run a search and save the search id. +First, you need to run a search and save the search ID. ```golang -// First, you need to run a search and save the search id. +// First, you need to run a search and save the search ID. auth := map[string]string{ "engine": "google", "api_key": "secret_api_key", @@ -172,7 +172,7 @@ It prints your account information. ## Basic examples in Go -### Search google +### Search Google ```golang import ( "github.com/serpapi/serpapi-golang" @@ -214,10 +214,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_google_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_test.go) -* see: [serpapi.com/search-api](https://serpapi.com/search-api) + * Source code: [test/example/example_search_google_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_test.go) +* See: [serpapi.com/search-api](https://serpapi.com/search-api) -### Search google light +### Search Google light ```golang import ( "github.com/serpapi/serpapi-golang" @@ -259,10 +259,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_google_light_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_light_test.go) -* see: [serpapi.com/google-light-api](https://serpapi.com/google-light-api) + * Source code: [test/example/example_search_google_light_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_light_test.go) +* See: [serpapi.com/google-light-api](https://serpapi.com/google-light-api) -### Search google scholar +### Search Google Scholar ```golang import ( "github.com/serpapi/serpapi-golang" @@ -304,10 +304,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_google_scholar_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_scholar_test.go) -* see: [serpapi.com/google-scholar-api](https://serpapi.com/google-scholar-api) + * Source code: [test/example/example_search_google_scholar_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_scholar_test.go) +* See: [serpapi.com/google-scholar-api](https://serpapi.com/google-scholar-api) -### Search google autocomplete +### Search Google autocomplete ```golang import ( "github.com/serpapi/serpapi-golang" @@ -349,10 +349,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_google_autocomplete_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_autocomplete_test.go) -* see: [serpapi.com/google-autocomplete-api](https://serpapi.com/google-autocomplete-api) + * Source code: [test/example/example_search_google_autocomplete_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_autocomplete_test.go) +* See: [serpapi.com/google-autocomplete-api](https://serpapi.com/google-autocomplete-api) -### Search google product +### Search Google product ```golang import ( "github.com/serpapi/serpapi-golang" @@ -395,10 +395,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_google_product_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_product_test.go) -* see: [serpapi.com/google-product-api](https://serpapi.com/google-product-api) + * Source code: [test/example/example_search_google_product_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_product_test.go) +* See: [serpapi.com/google-product-api](https://serpapi.com/google-product-api) -### Search google reverse image +### Search Google reverse image ```golang import ( "github.com/serpapi/serpapi-golang" @@ -440,10 +440,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_google_reverse_image_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_reverse_image_test.go) -* see: [serpapi.com/google-reverse-image](https://serpapi.com/google-reverse-image) + * Source code: [test/example/example_search_google_reverse_image_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_reverse_image_test.go) +* See: [serpapi.com/google-reverse-image](https://serpapi.com/google-reverse-image) -### Search google events +### Search Google events ```golang import ( "github.com/serpapi/serpapi-golang" @@ -485,10 +485,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_google_events_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_events_test.go) -* see: [serpapi.com/google-events-api](https://serpapi.com/google-events-api) + * Source code: [test/example/example_search_google_events_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_events_test.go) +* See: [serpapi.com/google-events-api](https://serpapi.com/google-events-api) -### Search google local services +### Search Google local services ```golang import ( "github.com/serpapi/serpapi-golang" @@ -531,10 +531,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_google_local_services_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_local_services_test.go) -* see: [serpapi.com/google-local-services-api](https://serpapi.com/google-local-services-api) + * Source code: [test/example/example_search_google_local_services_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_local_services_test.go) +* See: [serpapi.com/google-local-services-api](https://serpapi.com/google-local-services-api) -### Search google maps +### Search Google Maps ```golang import ( "github.com/serpapi/serpapi-golang" @@ -578,10 +578,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_google_maps_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_maps_test.go) -* see: [serpapi.com/google-maps-api](https://serpapi.com/google-maps-api) + * Source code: [test/example/example_search_google_maps_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_maps_test.go) +* See: [serpapi.com/google-maps-api](https://serpapi.com/google-maps-api) -### Search google jobs +### Search Google jobs ```golang import ( "github.com/serpapi/serpapi-golang" @@ -623,10 +623,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_google_jobs_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_jobs_test.go) -* see: [serpapi.com/google-jobs-api](https://serpapi.com/google-jobs-api) + * Source code: [test/example/example_search_google_jobs_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_jobs_test.go) +* See: [serpapi.com/google-jobs-api](https://serpapi.com/google-jobs-api) -### Search google play +### Search Google Play ```golang import ( "github.com/serpapi/serpapi-golang" @@ -669,10 +669,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_google_play_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_play_test.go) -* see: [serpapi.com/google-play-api](https://serpapi.com/google-play-api) + * Source code: [test/example/example_search_google_play_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_play_test.go) +* See: [serpapi.com/google-play-api](https://serpapi.com/google-play-api) -### Search google images +### Search Google Images ```golang import ( "github.com/serpapi/serpapi-golang" @@ -715,10 +715,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_google_images_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_images_test.go) -* see: [serpapi.com/images-results](https://serpapi.com/images-results) + * Source code: [test/example/example_search_google_images_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_images_test.go) +* See: [serpapi.com/images-results](https://serpapi.com/images-results) -### Search google lens +### Search Google Lens ```golang import ( "github.com/serpapi/serpapi-golang" @@ -760,10 +760,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_google_lens_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_lens_test.go) -* see: [serpapi.com/google-lens-api](https://serpapi.com/google-lens-api) + * Source code: [test/example/example_search_google_lens_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_lens_test.go) +* See: [serpapi.com/google-lens-api](https://serpapi.com/google-lens-api) -### Search google images light +### Search Google Images light ```golang import ( "github.com/serpapi/serpapi-golang" @@ -805,10 +805,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_google_images_light_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_images_light_test.go) -* see: [serpapi.com/google-images-light-api](https://serpapi.com/google-images-light-api) + * Source code: [test/example/example_search_google_images_light_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_images_light_test.go) +* See: [serpapi.com/google-images-light-api](https://serpapi.com/google-images-light-api) -### Search google hotels +### Search Google Hotels ```golang import ( "github.com/serpapi/serpapi-golang" @@ -856,10 +856,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_google_hotels_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_hotels_test.go) -* see: [serpapi.com/google-hotels-api](https://serpapi.com/google-hotels-api) + * Source code: [test/example/example_search_google_hotels_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_hotels_test.go) +* See: [serpapi.com/google-hotels-api](https://serpapi.com/google-hotels-api) -### Search google flights +### Search Google Flights ```golang import ( "github.com/serpapi/serpapi-golang" @@ -906,10 +906,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_google_flights_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_flights_test.go) -* see: [serpapi.com/google-flights-api](https://serpapi.com/google-flights-api) + * Source code: [test/example/example_search_google_flights_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_flights_test.go) +* See: [serpapi.com/google-flights-api](https://serpapi.com/google-flights-api) -### Search google finance +### Search Google Finance ```golang import ( "github.com/serpapi/serpapi-golang" @@ -925,7 +925,7 @@ It prints your account information. parameter := map[string]string{ "engine": "google_finance", - "q": "GOOG:NASDAQ", } + "q": "GOOG: NASDAQ", } rsp, err := client.Search(parameter) if err != nil { @@ -951,10 +951,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_google_finance_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_finance_test.go) -* see: [serpapi.com/google-finance-api](https://serpapi.com/google-finance-api) + * Source code: [test/example/example_search_google_finance_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_finance_test.go) +* See: [serpapi.com/google-finance-api](https://serpapi.com/google-finance-api) -### Search google ai overview +### Search Google AI overview ```golang import ( "github.com/serpapi/serpapi-golang" @@ -996,10 +996,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_google_ai_overview_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_ai_overview_test.go) -* see: [serpapi.com/google-ai-overview-api](https://serpapi.com/google-ai-overview-api) + * Source code: [test/example/example_search_google_ai_overview_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_ai_overview_test.go) +* See: [serpapi.com/google-ai-overview-api](https://serpapi.com/google-ai-overview-api) -### Search google news +### Search Google News ```golang import ( "github.com/serpapi/serpapi-golang" @@ -1043,10 +1043,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_google_news_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_news_test.go) -* see: [serpapi.com/google-news-api](https://serpapi.com/google-news-api) + * Source code: [test/example/example_search_google_news_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_news_test.go) +* See: [serpapi.com/google-news-api](https://serpapi.com/google-news-api) -### Search google news light +### Search Google News light ```golang import ( "github.com/serpapi/serpapi-golang" @@ -1088,10 +1088,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_google_news_light_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_news_light_test.go) -* see: [serpapi.com/google-news-light-api](https://serpapi.com/google-news-light-api) + * Source code: [test/example/example_search_google_news_light_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_news_light_test.go) +* See: [serpapi.com/google-news-light-api](https://serpapi.com/google-news-light-api) -### Search google patents +### Search Google Patents ```golang import ( "github.com/serpapi/serpapi-golang" @@ -1133,10 +1133,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_google_patents_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_patents_test.go) -* see: [serpapi.com/google-patents-api](https://serpapi.com/google-patents-api) + * Source code: [test/example/example_search_google_patents_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_patents_test.go) +* See: [serpapi.com/google-patents-api](https://serpapi.com/google-patents-api) -### Search google trends +### Search Google Trends ```golang import ( "github.com/serpapi/serpapi-golang" @@ -1152,7 +1152,7 @@ It prints your account information. parameter := map[string]string{ "engine": "google_trends", - "q": "coffee,milk,bread,pasta,steak", + "q": "coffee, milk, bread, pasta, steak", "data_type": "TIMESERIES", } rsp, err := client.Search(parameter) @@ -1179,10 +1179,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_google_trends_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_trends_test.go) -* see: [serpapi.com/google-trends-api](https://serpapi.com/google-trends-api) + * Source code: [test/example/example_search_google_trends_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_trends_test.go) +* See: [serpapi.com/google-trends-api](https://serpapi.com/google-trends-api) -### Search google shopping +### Search Google Shopping ```golang import ( "github.com/serpapi/serpapi-golang" @@ -1198,7 +1198,7 @@ It prints your account information. parameter := map[string]string{ "engine": "google_shopping", - "q": "Macbook M4", } + "q": "MacBook M4", } rsp, err := client.Search(parameter) if err != nil { @@ -1224,10 +1224,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_google_shopping_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_shopping_test.go) -* see: [serpapi.com/google-shopping-api](https://serpapi.com/google-shopping-api) + * Source code: [test/example/example_search_google_shopping_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_shopping_test.go) +* See: [serpapi.com/google-shopping-api](https://serpapi.com/google-shopping-api) -### Search google immersive product +### Search Google immersive product ```golang import ( "github.com/serpapi/serpapi-golang" @@ -1269,10 +1269,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_google_immersive_product_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_immersive_product_test.go) -* see: [serpapi.com/google-immersive-product-api](https://serpapi.com/google-immersive-product-api) + * Source code: [test/example/example_search_google_immersive_product_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_immersive_product_test.go) +* See: [serpapi.com/google-immersive-product-api](https://serpapi.com/google-immersive-product-api) -### Search google videos +### Search Google videos ```golang import ( "github.com/serpapi/serpapi-golang" @@ -1314,10 +1314,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_google_videos_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_videos_test.go) -* see: [serpapi.com/google-videos-api](https://serpapi.com/google-videos-api) + * Source code: [test/example/example_search_google_videos_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_google_videos_test.go) +* See: [serpapi.com/google-videos-api](https://serpapi.com/google-videos-api) -### Search amazon +### Search Amazon ```golang import ( "github.com/serpapi/serpapi-golang" @@ -1359,10 +1359,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_amazon_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_amazon_test.go) -* see: [serpapi.com/amazon-search-api](https://serpapi.com/amazon-search-api) + * Source code: [test/example/example_search_amazon_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_amazon_test.go) +* See: [serpapi.com/amazon-search-api](https://serpapi.com/amazon-search-api) -### Search baidu +### Search Baidu ```golang import ( "github.com/serpapi/serpapi-golang" @@ -1404,10 +1404,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_baidu_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_baidu_test.go) -* see: [serpapi.com/baidu-search-api](https://serpapi.com/baidu-search-api) + * Source code: [test/example/example_search_baidu_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_baidu_test.go) +* See: [serpapi.com/baidu-search-api](https://serpapi.com/baidu-search-api) -### Search yahoo +### Search Yahoo ```golang import ( "github.com/serpapi/serpapi-golang" @@ -1449,10 +1449,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_yahoo_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_yahoo_test.go) -* see: [serpapi.com/yahoo-search-api](https://serpapi.com/yahoo-search-api) + * Source code: [test/example/example_search_yahoo_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_yahoo_test.go) +* See: [serpapi.com/yahoo-search-api](https://serpapi.com/yahoo-search-api) -### Search youtube +### Search YouTube ```golang import ( "github.com/serpapi/serpapi-golang" @@ -1494,10 +1494,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_youtube_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_youtube_test.go) -* see: [serpapi.com/youtube-search-api](https://serpapi.com/youtube-search-api) + * Source code: [test/example/example_search_youtube_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_youtube_test.go) +* See: [serpapi.com/youtube-search-api](https://serpapi.com/youtube-search-api) -### Search walmart +### Search Walmart ```golang import ( "github.com/serpapi/serpapi-golang" @@ -1539,10 +1539,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_walmart_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_walmart_test.go) -* see: [serpapi.com/walmart-search-api](https://serpapi.com/walmart-search-api) + * Source code: [test/example/example_search_walmart_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_walmart_test.go) +* See: [serpapi.com/walmart-search-api](https://serpapi.com/walmart-search-api) -### Search ebay +### Search eBay ```golang import ( "github.com/serpapi/serpapi-golang" @@ -1584,10 +1584,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_ebay_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_ebay_test.go) -* see: [serpapi.com/ebay-search-api](https://serpapi.com/ebay-search-api) + * Source code: [test/example/example_search_ebay_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_ebay_test.go) +* See: [serpapi.com/ebay-search-api](https://serpapi.com/ebay-search-api) -### Search naver +### Search Naver ```golang import ( "github.com/serpapi/serpapi-golang" @@ -1629,10 +1629,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_naver_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_naver_test.go) -* see: [serpapi.com/naver-search-api](https://serpapi.com/naver-search-api) + * Source code: [test/example/example_search_naver_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_naver_test.go) +* See: [serpapi.com/naver-search-api](https://serpapi.com/naver-search-api) -### Search home depot +### Search Home Depot ```golang import ( "github.com/serpapi/serpapi-golang" @@ -1674,10 +1674,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_home_depot_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_home_depot_test.go) -* see: [serpapi.com/home-depot-search-api](https://serpapi.com/home-depot-search-api) + * Source code: [test/example/example_search_home_depot_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_home_depot_test.go) +* See: [serpapi.com/home-depot-search-api](https://serpapi.com/home-depot-search-api) -### Search apple app store +### Search Apple App Store ```golang import ( "github.com/serpapi/serpapi-golang" @@ -1719,10 +1719,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_apple_app_store_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_apple_app_store_test.go) -* see: [serpapi.com/apple-app-store](https://serpapi.com/apple-app-store) + * Source code: [test/example/example_search_apple_app_store_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_apple_app_store_test.go) +* See: [serpapi.com/apple-app-store](https://serpapi.com/apple-app-store) -### Search duckduckgo +### Search DuckDuckGo ```golang import ( "github.com/serpapi/serpapi-golang" @@ -1764,10 +1764,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_duckduckgo_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_duckduckgo_test.go) -* see: [serpapi.com/duckduckgo-search-api](https://serpapi.com/duckduckgo-search-api) + * Source code: [test/example/example_search_duckduckgo_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_duckduckgo_test.go) +* See: [serpapi.com/duckduckgo-search-api](https://serpapi.com/duckduckgo-search-api) -### Search yandex +### Search Yandex ```golang import ( "github.com/serpapi/serpapi-golang" @@ -1809,10 +1809,10 @@ It prints your account information. ``` - * source code: [test/example/example_search_yandex_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_yandex_test.go) -* see: [serpapi.com/yandex-search-api](https://serpapi.com/yandex-search-api) + * Source code: [test/example/example_search_yandex_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_yandex_test.go) +* See: [serpapi.com/yandex-search-api](https://serpapi.com/yandex-search-api) -### Search yelp +### Search Yelp ```golang import ( "github.com/serpapi/serpapi-golang" @@ -1855,8 +1855,8 @@ It prints your account information. ``` - * source code: [test/example/example_search_yelp_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_yelp_test.go) -* see: [serpapi.com/yelp-search-api](https://serpapi.com/yelp-search-api) + * Source code: [test/example/example_search_yelp_test.go](https://github.com/serpapi/serpapi-golang/blob/master/test/example/example_search_yelp_test.go) +* See: [serpapi.com/yelp-search-api](https://serpapi.com/yelp-search-api) ## Advanced search API usage ### Highly scalable batching @@ -1866,8 +1866,8 @@ Search API features non-blocking search using the option: `async=true`. - Blocking - async=false - many processes must be forked and synchronized to handle concurrent searches. This strategy is I/O intensive because each client would hold a network connection. Search API enables `async` search. - - Non-blocking (`async=true`) : the development is more complex, but this allows handling many simultaneous connections. - - Blocking (`async=false`) : it's easy to write the code but more compute-intensive when the parent process needs to hold many connections. + - Non-blocking (`async=true`): the development is more complex, but this allows handling many simultaneous connections. + - Blocking (`async=false`): it's easy to write the code, but more compute-intensive when the parent process needs to hold many connections. Here is an example of asynchronous searches using Go ```golang @@ -1886,8 +1886,8 @@ import ( ) /*** - * The code snippet aims to improve the efficiency of searching using the SerpApi client using `async` mode. - * The request are non-blocking which allows batching a large amount of query, and wait before fetching the result back. + * The code snippet aims to improve the efficiency of searching using the SerpApi client in `async` mode. + * The requests are non-blocking, which allows batching a large number of queries and waiting before fetching the results back. * * **Process:** * 1. **Request Queue:** The company list is iterated over, and each company is queried using the SerpApi client. Requests @@ -1936,7 +1936,7 @@ func main() { client := serpapi.NewClient(setting) // Target MAANG companies - companyList := []string{"meta", "amazon", "apple", "netflix", "google"} + companyList:= []string{"meta", "amazon", "apple", "netflix", "google"} scheduleSearch := make(chan string, len(companyList)) var lastSearchMetadata map[string]interface{} @@ -1997,12 +1997,12 @@ func main() { * source code: [demo/demo_async.go](https://github.com/serpapi/serpapi-golang/blob/master/demo/demo_async.go) This code shows a simple solution to batch searches asynchronously into a [queue](https://en.wikipedia.org/wiki/Queue_(abstract_data_type)). -Each search takes a few seconds before completion by SerpApi service and the search engine. By the time the first element pops out of the queue. The search result might be already available in the archive. If not, the `search_archive` method blocks until the search results are available. +Each search takes a few seconds to complete via the SerpApi service and the search engine. By the time the first element pops out of the queue. The search result might already be available in the archive. If not, the `search_archive` method blocks until the search results are available. -## Supported Go version. -Go versions validated by Github Actions: +## Supported Go versions. +Go versions validated by GitHub Actions: - 1.17+ - * see: [Github Actions.](https://github.com/serpapi/serpapi-golang/actions/workflows/ci.yml) + * see: [GitHub Actions.](https://github.com/serpapi/serpapi-golang/actions/workflows/ci.yml) ## Change logs * [2026-01-26] 1.1.0 Asynchronous & Persistent Mode Support @@ -2014,28 +2014,28 @@ Go versions validated by Github Actions: ## Developer Guide ### Key goals - - Brand centric instead of search engine based + - Brand-centric instead of search engine-based - No hard-coded logic per search engine - Simple HTTP client (lightweight, reduced dependency) - No magic default values - - Thread safe + - Thread-safe - Easy extension - Defensive code style (raise a custom exception) - TDD - Best API coding practice per platform - - KiSS principles + - KISS principles ### Inspirations The source code and coding style of this project are inspired by Go. The Go programming language provides native recommendations for building excellent software. ### Code quality expectations - - 0 lint offense: `make lint` + - 0 lint offenses: `make lint` - 100% tests passing: `make test` - 100% code coverage: `make test` # Developer Guide -## Design : UML diagram +## Design: UML diagram ### Class diagram ```mermaid classDiagram @@ -2067,7 +2067,7 @@ sequenceDiagram ``` where: - The end user implements the application. - - Client refers to serpapi.Client. + - Client refers to SerpApi.Client. - SerpApi.com is the backend HTTP / REST service. - Engine refers to Google, Baidu, Bing, and more. @@ -2075,17 +2075,17 @@ The SerpApi.com service (backend) - executes a scalable search on `engine: "google"` using the search query: `q: "coffee"`. - parses the messy HTML responses from Google on the backend. - returns a standardized JSON response. -The class serpapi.Client (client side / golang): - - Format the request to SerpApi.com server. - - Execute HTTP Get request. - - Parse JSON into Go map using a standard JSON library. +The class serpapi.Client (client-side / Golang): + - Formats the request to the SerpApi.com server. + - Executes an HTTP GET request. + - Parses JSON into a Go map using a standard JSON library. Et voila! ## Continuous integration -We love "true open source" and "continuous integration", and Test Drive Development (TDD). - We are using Go test to test [our infrastructure around the clock]) using Github Action to achieve the best QoS (Quality Of Service). +We love "true open source" and "continuous integration", and Test-Driven Development (TDD). + We are using Go tests to test [our infrastructure around the clock]) using GitHub Actions to achieve the best QoS (Quality of Service). -The directory test/ includes specification which serves the dual purposes of examples and functional tests. +The directory test/ includes specification which serves the dual purpose of examples and functional tests. Set your secret API key in your shell before running a test. ```bash @@ -2095,8 +2095,8 @@ Install testing dependency ```bash $ make test ``` -Contributions are welcome. Feel to submit a pull request! +Contributions are welcome. Feel free to submit a pull request! ## License -MIT License. \ No newline at end of file +MIT License.