Skip to content

gofeed

2,887 2 33 MIT
v1.5.0 (25 Sep 2026) Apr 20 2016 58.1 thousand (month)

The gofeed library is a robust feed parser that supports parsing both RSS, Atom and JSON feeds. The library provides a universal gofeed.Parser that will parse and convert all feed types into a hybrid gofeed.Feed model.

You also have the option of utilizing the feed specific atom.Parser or rss.Parser or json.Parser parsers which generate atom. Feed , rss.Feed and json.Feed respectively.

Supported feed types:

  • RSS 0.90
  • Netscape RSS 0.91
  • Userland RSS 0.91
  • RSS 0.92
  • RSS 0.93
  • RSS 0.94
  • RSS 1.0
  • RSS 2.0
  • Atom 0.3
  • Atom 1.0
  • JSON 1.0
  • JSON 1.1

Example Use


// parse feed from URL
fp := gofeed.NewParser()
fp.UserAgent = "MyCustomAgent 1.0"  // we can modify http client with custom headers etc.
feed, _ := fp.ParseURL("http://feeds.twit.tv/twit.xml")
fmt.Println(feed.Title)

// parse feed from string
feedData := `<rss version="2.0">
<channel>
<title>Sample Feed</title>
</channel>
</rss>`
fp := gofeed.NewParser()
feed, _ := fp.ParseString(feedData)
fmt.Println(feed.Title)

// or file
file, _ := os.Open("/path/to/a/file.xml")
defer file.Close()
fp := gofeed.NewParser()
feed, _ := fp.Parse(file)
fmt.Println(feed.Title)

Alternatives / Similar


Other Languages

7,252 2.4.0 (2026-11-23 17:52:00 ago) Jul 17 2019 compare
2,175 2025.4.15 (2025-04-15 04:02:28 ago) Dec 14 2008 compare
2,891 0.9 (2026-08-27 19:29:58 ago) Jun 30 2011 compare
986 0.18.0 (2024-11-08 14:59:22 ago) Oct 27 2015 compare
15,189 0.2.8 (2018-09-28 04:58:18 ago) Dec 28 2012 compare
3,700 0.14.0 (2026-11-22 13:59:53 ago) Oct 20 2013 compare
13,434 1.1.9 (2018-10-21 03:39:17 ago) Aug 24 2018 compare
301 2.0.7 (2022-11-06 07:33:14 ago) Dec 11 2020 compare
Was this page helpful?