Skip to content

felipdc/zyte-api-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zyte API Go Wrapper

This is a Go wrapper for the Zyte API. Zyte API is a web scraping API that allows you to extract data from websites using antibot and proxy capabilities. This wrapper aims to provide an easy way to call the Zyte API using Go.

Please note that this wrapper is still under development and may contain bugs.

Getting Started

Prerequisites

  • Go 1.16 or higher
  • A Zyte API account and API key

Installation

To install the wrapper, run the following command:

go get github.com/felipdc/zyte-api-go/pkg/zyte_api_go

Usage

To use the wrapper, you first need to create a client:

import (
    "github.com/felipdc/zyte-api-go/pkg/zyte_api_go"
)

func main() {
    e := zyte_api_go.NewExtractor("YOUR_API_KEY")
}

You can then use the client to make API requests:

// Set options
schema := zyte_api_go.RequestSchema{
    Url:              "http://books.toscrape.com/",
    HttpResponseBody: true,
}

options := zyte_api_go.Options{
    Schema: schema,
}

// Scrape a website
response := e.Extract(options)

// Print the response
fmt.Println(response)

Parameters development

Below is a table describing which parameter is currently supported.

Parameter Done
requestHeaders
httpRequestMethod
httpRequestBody
httpRequestText
customHttpRequestHeaders
httpResponseBody
httpResponseHeaders
browserHtml
screenshot
screenshotOptions
geolocation
javascript
actions
jobId
echoData
experimental

For more information about ZyteAPI, please refer to the documentation.

About

Zyte API Wrapper implemented with Go

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages