Skip to content

dentot/SEOMozAPIGolang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SEOMozAPIGolang

Golang for Moz API - currently very limited, only for the url-metrics

Install:

go get github.com/dentot/SEOMozAPIGolang

Usage:

urls := []string{"http://google.com", "http://yahoo.com"}

var cols uint64 = MozApi.URL_METRICS_PAGE_AUTHORITY | MozApi.URL_METRICS_DOMAIN_AUTHORITY

//supply your accessid and key
b, err := MozApi.GetURLMetrics("mozscape-accessid", "secretkey", cols, 300, urls)
if err != nil {
	panic(err)
}

// check if no error from moz api server
isError, data, err := MozApi.CheckResultError(b)
if isError {
	panic(data["error_message"])
}

// if no error, then extract the moz data
res, err := MozApi.ExtractMozData(b)
fmt.Println("The first item, upa of google.com", res[0]["upa"])
fmt.Println("The 2nd item, upa of yahoo.com", res[1]["upa"])

About

Golang Moz API - bare

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages