The library provides convenient access to the Outscraper API from applications written in the Go language. Allows using Outscraper's services from your code.
Go 1.10+ must be already installed.
Make sure your project is using Go Modules (it will have a go.mod file in its root if it already is):
go mod init
go get -u github.com/outscraper/outscraper-go
package main
import (
"fmt"
"github.com/outscraper/outscraper-go"
)
client := outscraper.Client{ApiKey: "SECRET_API_KEY"}
Link to the profile page to create the API key
// Search for businesses in specific locations:
results, _ := client.GoogleMapsSearch(map[string]string {
"query": "bars ny usa",
"limit": "10",
})
fmt.Println(results)
// Get data of the specific place by id
results, _ := client.GoogleMapsSearch(map[string]string {
"query": "rChIJrc9T9fpYwokRdvjYRHT8nI4",
"language": "en",
})
fmt.Println(results)
// Get reviews of the specific place by id
results, _ := client.GoogleMapsReviews(map[string]string {
"query": "rChIJrc9T9fpYwokRdvjYRHT8nI4",
"reviewsLimit": "20",
"language": "en",
})
fmt.Println(results)
// Search contacts from website
results, _ := client.EmailsAndContacts(map[string]string {
"query": "outscraper.com",
})
fmt.Println(results)
Bug reports and pull requests are welcome on GitHub at https://github.com/outscraper/outscraper-go.