{"id":37182268,"url":"https://github.com/iamwavecut/go-tavily","last_synced_at":"2026-01-14T21:01:06.392Z","repository":{"id":299892855,"uuid":"1004541116","full_name":"iamwavecut/go-tavily","owner":"iamwavecut","description":"Tavily SDK written in Go (unofficial)","archived":false,"fork":false,"pushed_at":"2025-06-18T20:44:41.000Z","size":14,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-20T10:35:09.470Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iamwavecut.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-18T19:40:18.000Z","updated_at":"2025-08-30T14:30:52.000Z","dependencies_parsed_at":"2025-06-18T21:27:23.867Z","dependency_job_id":"be9f0595-c8dd-4bb5-9581-4c2078ece540","html_url":"https://github.com/iamwavecut/go-tavily","commit_stats":null,"previous_names":["iamwavecut/go-tavily"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iamwavecut/go-tavily","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamwavecut%2Fgo-tavily","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamwavecut%2Fgo-tavily/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamwavecut%2Fgo-tavily/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamwavecut%2Fgo-tavily/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iamwavecut","download_url":"https://codeload.github.com/iamwavecut/go-tavily/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamwavecut%2Fgo-tavily/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28434517,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T21:01:04.162Z","updated_at":"2026-01-14T21:01:06.327Z","avatar_url":"https://github.com/iamwavecut.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔍 Go Tavily Client\n\n[![Go Version](https://img.shields.io/badge/Go-1.24+-00ADD8?style=for-the-badge\u0026logo=go)](https://golang.org/dl/)\n[![Go Report Card](https://goreportcard.com/badge/github.com/iamwavecut/go-tavily?style=for-the-badge)](https://goreportcard.com/report/github.com/iamwavecut/go-tavily)\n[![GoDoc](https://img.shields.io/badge/pkg.go.dev-reference-007d9c?style=for-the-badge\u0026logo=go)](https://pkg.go.dev/github.com/iamwavecut/go-tavily)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)\n[![Tests](https://img.shields.io/badge/Tests-Passing-brightgreen?style=for-the-badge\u0026logo=github-actions)](https://github.com/iamwavecut/go-tavily/actions)\n\nA modern, flexible Go client for the [Tavily AI-powered search and web content extraction API](https://docs.tavily.com). Built for Go 1.24+ with modern idioms and best practices.\n\n## 🚀 Features\n\n| Feature             | Description                                                | Status      |\n| ------------------- | ---------------------------------------------------------- | ----------- |\n| **Search**          | Web search with intelligent results aggregation            | ✅ Supported |\n| **Extract**         | Content extraction from specific URLs                      | ✅ Supported |\n| **Crawl**           | Intelligent website crawling and content mapping           | ✅ Supported |\n| **Map**             | Website structure discovery and mapping                    | ✅ Supported |\n| **Context Support** | Full context.Context integration for cancellation/timeouts | ✅ Modern    |\n| **Error Handling**  | Typed errors with semantic checking methods                | ✅ Robust    |\n| **Testing**         | Comprehensive test suite                                   | ✅ Complete  |\n| **Performance**     | Built for Go 1.24+                                         | ⚡ Optimized |\n\n## 📦 Installation\n\n```bash\ngo get github.com/iamwavecut/go-tavily\n```\n\n## 🔧 Quick Start\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"log\"\n    \n    \"github.com/iamwavecut/go-tavily\"\n)\n\nfunc main() {\n    // Create client (uses TAVILY_API_KEY env var if empty)\n    client := tavily.New(\"tvly-your-api-key\", nil)\n    \n    ctx := context.Background()\n    \n    // Simple search\n    result, err := client.SearchSimple(ctx, \"Go programming language\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    \n    fmt.Printf(\"Found %d results in %.2fs\\n\", \n        len(result.Results), result.ResponseTime)\n}\n```\n\n## 📖 Usage Examples\n\n### 🔍 Advanced Search\n\n```go\nopts := \u0026tavily.SearchOptions{\n    SearchDepth:    string(tavily.SearchDepthAdvanced),\n    Topic:          string(tavily.TopicNews),\n    MaxResults:     10,\n    IncludeAnswer:  true,\n    IncludeImages:  tavily.BoolPtr(true),\n    TimeRange:      string(tavily.TimeRangeWeek),\n    IncludeDomains: []string{\"github.com\", \"golang.org\"},\n    Country:        \"US\",\n}\n\nresult, err := client.Search(ctx, \"Go 1.24 release\", opts)\n```\n\n### 🌐 Content Extraction\n\n```go\nurls := []string{\n    \"https://golang.org/doc/\",\n    \"https://pkg.go.dev/\",\n}\n\nopts := \u0026tavily.ExtractOptions{\n    Format:        string(tavily.FormatMarkdown),\n    ExtractDepth:  string(tavily.SearchDepthAdvanced),\n    IncludeImages: tavily.BoolPtr(true),\n}\n\nresult, err := client.Extract(ctx, urls, opts)\n```\n\n### 🕷️ Website Crawling\n\n```go\nopts := \u0026tavily.CrawlOptions{\n    MaxDepth:      2,\n    MaxBreadth:    10,\n    Limit:         20,\n    SelectPaths:   []string{\"/docs/*\", \"/api/*\"},\n    Categories:    []tavily.CrawlCategory{\n        tavily.CategoryDocumentation,\n        tavily.CategoryDeveloper,\n    },\n    Format:        string(tavily.FormatMarkdown),\n    AllowExternal: tavily.BoolPtr(false),\n}\n\nresult, err := client.Crawl(ctx, \"https://docs.tavily.com\", opts)\n```\n\n### 🗺️ Website Mapping\n\n```go\nopts := \u0026tavily.MapOptions{\n    MaxDepth:    3,\n    Limit:       100,\n    Categories:  []tavily.CrawlCategory{\n        tavily.CategoryDocumentation,\n        tavily.CategoryBlog,\n    },\n    SelectPaths: []string{\"/docs/*\", \"/blog/*\"},\n}\n\nresult, err := client.Map(ctx, \"https://docs.tavily.com\", opts)\n```\n\n## 🎯 Convenience Methods\n\n| Method                 | Purpose                              | Example          |\n| ---------------------- | ------------------------------------ | ---------------- |\n| `SearchSimple()`       | Basic search with minimal config     | Quick searches   |\n| `SearchWithAnswer()`   | Search with AI-generated answer      | Q\u0026A applications |\n| `SearchNews()`         | News-focused search with time filter | Recent updates   |\n| `ExtractSimple()`      | Single URL extraction                | Content analysis |\n| `ExtractWithImages()`  | Multi-URL extraction with images     | Rich content     |\n| `CrawlDocumentation()` | Documentation-focused crawling       | API docs, guides |\n| `MapSite()`            | Quick website structure mapping      | Site analysis    |\n| `GetSearchContext()`   | RAG-formatted search results         | AI applications  |\n\n## 🛠️ Configuration\n\n### Client Options\n\n```go\nopts := \u0026tavily.Options{\n    BaseURL:    \"https://api.tavily.com\",  // Custom API endpoint\n    HTTPClient: customHTTPClient,          // Custom HTTP client\n    Timeout:    45 * time.Second,         // Request timeout\n}\n\nclient := tavily.New(\"your-api-key\", opts)\n```\n\n### Custom HTTP Client\n\n```go\ncustomClient := \u0026http.Client{\n    Timeout: 45 * time.Second,\n    Transport: \u0026http.Transport{\n        MaxIdleConns:       10,\n        IdleConnTimeout:    30 * time.Second,\n        DisableCompression: true,\n    },\n}\n\nclient := tavily.New(\"your-api-key\", \u0026tavily.Options{\n    HTTPClient: customClient,\n})\n```\n\n## 🚨 Error Handling\n\nThe client provides semantic error checking methods:\n\n```go\nresult, err := client.Search(ctx, \"query\", nil)\nif err != nil {\n    if apiErr, ok := err.(*tavily.APIError); ok {\n        switch {\n        case apiErr.IsUnauthorized():\n            fmt.Println(\"Invalid API key\")\n        case apiErr.IsRateLimit():\n            fmt.Println(\"Rate limit exceeded\")\n        case apiErr.IsForbidden():\n            fmt.Println(\"Access forbidden\")\n        case apiErr.IsBadRequest():\n            fmt.Println(\"Invalid parameters\")\n        default:\n            fmt.Printf(\"API error: %s\\n\", apiErr.Message)\n        }\n    } else {\n        fmt.Printf(\"Other error: %v\\n\", err)\n    }\n}\n```\n\n## 🧪 Testing\n\nThe client includes comprehensive tests:\n\n```bash\n# Run all tests\ngo test -v ./...\n\n# Run benchmarks with new testing.B.Loop\ngo test -bench=. -count=3\n\n# Test with coverage\ngo test -cover ./...\n```\n\n## 🏃‍♂️ Demo Application\n\n```bash\n# Set your API key\nexport TAVILY_API_KEY=\"tvly-your-api-key\"\n\n# Run the demo\ngo run cmd/demo/main.go\n```\n\n## 🔧 Environment Variables\n\n| Variable             | Description         | Required   |\n| -------------------- | ------------------- | ---------- |\n| `TAVILY_API_KEY`     | Your Tavily API key | ✅ Yes      |\n| `TAVILY_HTTP_PROXY`  | HTTP proxy URL      | ❌ Optional |\n| `TAVILY_HTTPS_PROXY` | HTTPS proxy URL     | ❌ Optional |\n\n## 📋 API Coverage\n\n| Endpoint   | Method      | Status     | Features                                  |\n| ---------- | ----------- | ---------- | ----------------------------------------- |\n| `/search`  | `Search()`  | ✅ Complete | All parameters, answer generation, images |\n| `/extract` | `Extract()` | ✅ Complete | Multi-URL, formats, depth control         |\n| `/crawl`   | `Crawl()`   | ✅ Complete | Path filtering, categories, depth limits  |\n| `/map`     | `Map()`     | ✅ Complete | Structure discovery, URL filtering        |\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Add tests for new functionality\n4. Ensure all tests pass: `go test -v ./...`\n5. Submit a pull request\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🔗 Related Links\n\n- [Tavily API Documentation](https://docs.tavily.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamwavecut%2Fgo-tavily","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamwavecut%2Fgo-tavily","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamwavecut%2Fgo-tavily/lists"}