{"id":44871815,"url":"https://github.com/zeet-dev/cloudflare-graphql-go","last_synced_at":"2026-02-17T13:12:55.504Z","repository":{"id":242780198,"uuid":"810519720","full_name":"zeet-dev/cloudflare-graphql-go","owner":"zeet-dev","description":"Go client library SDK for interacting with Cloudflare's GraphQL API","archived":false,"fork":false,"pushed_at":"2024-06-12T22:57:29.000Z","size":203,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-19T03:13:28.117Z","etag":null,"topics":["cloudflare","cloudflare-analytics","cloudflare-api","go","golang","graphql","sdk"],"latest_commit_sha":null,"homepage":"https://github.com/zeet-dev/cloudflare-graphql-go","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/zeet-dev.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}},"created_at":"2024-06-04T21:18:57.000Z","updated_at":"2024-06-19T03:13:28.118Z","dependencies_parsed_at":"2024-06-11T22:03:58.546Z","dependency_job_id":null,"html_url":"https://github.com/zeet-dev/cloudflare-graphql-go","commit_stats":null,"previous_names":["zeet-dev/cloudflare-graphql-go"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/zeet-dev/cloudflare-graphql-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeet-dev%2Fcloudflare-graphql-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeet-dev%2Fcloudflare-graphql-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeet-dev%2Fcloudflare-graphql-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeet-dev%2Fcloudflare-graphql-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeet-dev","download_url":"https://codeload.github.com/zeet-dev/cloudflare-graphql-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeet-dev%2Fcloudflare-graphql-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29545332,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T13:00:00.370Z","status":"ssl_error","status_checked_at":"2026-02-17T12:57:14.072Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["cloudflare","cloudflare-analytics","cloudflare-api","go","golang","graphql","sdk"],"created_at":"2026-02-17T13:12:54.769Z","updated_at":"2026-02-17T13:12:55.492Z","avatar_url":"https://github.com/zeet-dev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cloudflare GraphQL Go\n\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nCloudflare GraphQL Go is a Go client library SDK for interacting with Cloudflare's GraphQL API. This library provides a convenient and idiomatic way to query Cloudflare's analytics data using GraphQL.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Examples](#examples)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Features\n\n- Easy-to-use Go client for Cloudflare's GraphQL API\n- Supports querying analytics data for workers and zones\n- Automatically generated Go types from GraphQL schema\n- Includes examples for quick start\n\n## Installation\n\nTo install the Cloudflare GraphQL Go library, use `go get`:\n\n```sh\ngo get github.com/zeet-dev/cloudflare-graphql-go\n```\n\n## Usage\n\nFirst, import the library in your Go code:\n\n```go\nimport (\n    \"github.com/zeet-dev/cloudflare-graphql-go/pkg/cloudflaregraphql\"\n    \"github.com/cloudflare/cloudflare-go\"\n)\n```\n\nInitialize the client:\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"log\"\n    \"os\"\n    \"time\"\n\n    \"github.com/cloudflare/cloudflare-go\"\n    \"github.com/zeet-dev/cloudflare-graphql-go/pkg/cloudflaregraphql\"\n)\n\nfunc main() {\n    cfApiToken := os.Getenv(\"CF_API_TOKEN\")\n\n    debug := os.Getenv(\"DEBUG\") == \"true\"\n\n    api, err := cloudflare.NewWithAPIToken(cfApiToken)\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    client, err := cloudflaregraphql.New(\n        func(o *cloudflaregraphql.ClientOption) {\n            o.CloudflareAPIToken = cfApiToken\n            o.Debug = debug\n        })\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    ctx := context.Background()\n\n    zones, err := api.ListZonesContext(ctx)\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    for _, zone := range zones.Result {\n        zoneTag := zone.ID\n\n        currentDate := time.Now().UTC().Format(\"2006-01-02\")\n        sinceDate := time.Now().UTC().AddDate(0, 0, -3).Format(\"2006-01-02\")\n        result, err := client.GetZoneAnalyticsByDayQuery(ctx, \u0026zoneTag, sinceDate, currentDate)\n        if err != nil {\n            log.Fatal(err)\n        }\n\n        log.Println(\"Zone Analytics Results:\", zone.Name)\n        for _, zoneResult := range result.Viewer.Zones[0].Zones {\n            date := zoneResult.Dimensions.Timeslot\n            value := zoneResult.Sum.Requests\n            log.Printf(\"Date: %s, Requests: %d\\n\", date, value)\n        }\n    }\n}\n```\n\nSee [cmd/cfgo/cfgo.go](cmd/cfgo) for more complete examples\n\n## Contributing\n\nContributions are welcome! Please follow these steps:\n\n1. Fork the repository.\n2. Create a new branch for your feature or bugfix.\n3. Write your code and tests.\n4. Ensure all tests pass.\n5. Submit a pull request.\n\nPlease make sure to update tests as appropriate.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- Special thanks to the contributors and the open-source community for their continuous support.\n- [Cloudflare](https://www.cloudflare.com) for providing the GraphQL API.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeet-dev%2Fcloudflare-graphql-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeet-dev%2Fcloudflare-graphql-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeet-dev%2Fcloudflare-graphql-go/lists"}