Skip to content
/ newsapi Public

Client for newsapi.org free json api in Golang

Notifications You must be signed in to change notification settings

bas24/newsapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Client for newsapi.org api written in Golang.

Install:
go get github.com/bas24/newsapi

Getting articles:

package main

import(
	"fmt"
	"github.com/bas24/newsapi"
)

func main(){
	result, err := newsapi.GetArticles("YOUR_API_KEY")
	if err != nil {
		fmt.Println(err)
	}
	for _, v := range result{
		fmt.Println(v)
	}
}

If you want to get the topic for feed source, just:

package main

import(
	"fmt"
	"github.com/bas24/newsapi"
)

func main(){
	topic := newsapi.GetTopic("bbc-news")
	fmt.Println(topic)
}

About

Client for newsapi.org free json api in Golang

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages