Skip to content

jpadilla/alchemyapi-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go AlchemyAPI Build Status

Go client library for AlchemyAPI.

Supported API Calls

  • Text Extraction
    • URLGetText
    • URLGetTitle

Versioning

Each revision of the binding is tagged and the version is updated accordingly.

Given Go's lack of built-in versioning, it is highly recommended you use a package management tool in order to ensure a newer version of the binding does not affect backwards compatibility.

To see the list of past versions, run git tag. To manually get an older version of the client, clone this repo, checkout the specific tag and build the library:

git clone https://github.com/jpadilla/alchemyapi-go.git
cd alchemyapi-go
git checkout api_version_tag
make build

Installation

go get github.com/jpadilla/alchemyapi-go

Documentation

For details on all the functionality in this library, see the GoDoc documentation.

Example usage

package main

import (
    "log"

    alchemyapi "github.com/jpadilla/alchemyapi-go"
)

func main() {
    alchemyAPIKey = "ALCHEMY_API_KEY"
    alchemyClient := alchemyapi.New(alchemyAPIKey)

    titleResponse, err := alchemyClient.GetTitle(data.URL, alchemyapi.GetTitleOptions{})

    if err != nil {
        log.Fatal(err)
    }

    log.Printf("%v\n", titleResponse.Title)

    textResponse, err := alchemyClient.GetText(data.URL, alchemyapi.GetTextOptions{})

    if err != nil {
        log.Fatal(err)
    }

    log.Printf("%v\n", textResponse.Text)
}

About

Go client library for AlchemyAPI

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages