Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jpadilla/alchemyapi-go
Go client library for AlchemyAPI
https://github.com/jpadilla/alchemyapi-go
alchemyapi go
Last synced: 5 days ago
JSON representation
Go client library for AlchemyAPI
- Host: GitHub
- URL: https://github.com/jpadilla/alchemyapi-go
- Owner: jpadilla
- License: mit
- Created: 2014-09-25T10:49:20.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-11-20T17:08:17.000Z (almost 10 years ago)
- Last Synced: 2024-10-12T07:26:21.326Z (about 1 month ago)
- Topics: alchemyapi, go
- Language: Go
- Homepage:
- Size: 184 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Go AlchemyAPI [![Build Status](https://travis-ci.org/jpadilla/alchemyapi-go.svg?branch=master)](https://travis-ci.org/jpadilla/alchemyapi-go)
Go client library for [AlchemyAPI](http://www.alchemyapi.com/).
## 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](https://code.google.com/p/go-wiki/wiki/PackageManagementTools) 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:```sh
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](http://godoc.org/github.com/jpadilla/alchemyapi-go) documentation.
## Example usage
```go
package mainimport (
"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)
}```