{"id":23591479,"url":"https://github.com/dvob/go-project-usage","last_synced_at":"2025-11-04T06:30:30.631Z","repository":{"id":57571166,"uuid":"347456550","full_name":"dvob/go-project-usage","owner":"dvob","description":"Find out by which other Go projects a  Go project is used","archived":false,"fork":false,"pushed_at":"2024-05-04T19:57:25.000Z","size":16,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-16T10:45:30.059Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dvob.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-03-13T19:09:11.000Z","updated_at":"2024-12-19T04:55:38.000Z","dependencies_parsed_at":"2024-06-20T11:14:00.224Z","dependency_job_id":"d2583e72-c393-40ff-a638-1b87d2bfca33","html_url":"https://github.com/dvob/go-project-usage","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvob%2Fgo-project-usage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvob%2Fgo-project-usage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvob%2Fgo-project-usage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvob%2Fgo-project-usage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dvob","download_url":"https://codeload.github.com/dvob/go-project-usage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239426226,"owners_count":19636540,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-12-27T07:39:10.117Z","updated_at":"2025-11-04T06:30:30.598Z","avatar_url":"https://github.com/dvob.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-project-usage\ngo-project-usage lists Github repositories which use a certain Go project. The repository list is sorted by stars so that you can spot more relevant repositories easily. For example if you are intressted which projects are using Nats you can run the following command:\n```\n$ go-project-usage github.com/nats-io/nats.go\nSTARS FORKS PROJECT\n...\n7297  444   https://github.com/tidwall/tile38\n8973  885   https://github.com/nats-io/nats-server\n9795  844   https://github.com/micro/micro\n9876  4159  https://github.com/influxdata/telegraf\n15529 1664  https://github.com/asim/go-micro\n19621 2025  https://github.com/go-kit/kit\n26475 2870  https://github.com/minio/minio\n```\n\nTo run `go-project-usage` you have to configure a [personal access token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) to access the Github GrapQL API (Settings -\u003e Developer settings -\u003e Personal access tokens).\n```\nexport GITHUB_TOKEN=...\n```\nWhen you create the access token you don't have to select any scopes. The only purpose of the token is that Github can authenticate your requests to the GraphQL API.\n\n## How does it work?\nTo find the projects and obtain the star count the follwing steps are preformed:\n1. Call https://pkg.go.dev/%s?tab=importedby to figure out which projects import the project we are looking for.\n2. Call the Github GraphQL API https://api.github.com/graphql to obtain the star and fork count\n\nWe use the GraphQL API that we can obtain the star count for many projects with a single API call. If we would use the REST API we would hit the rate limit of Github quite fast.\n\n## Github\n### Links\n* Rate limit: https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting\n* GraphQL API Explorer: https://docs.github.com/en/graphql/overview/explorer\n\n### Test Queries with curl\n* Configure personal access token for Github\n```\nexport GITHUB_TOKEN=...\n```\n* Prepare query in  file (e.g. `query.graphql`)\n```\n{\n  _1: repository(name: \"pcert\", owner: \"dvob\") {nameWithOwner forkCount isFork isArchived isInOrganization stargazerCount}\n  _2: repository(name: \"vu\", owner: \"dvob\") {nameWithOwner forkCount isFork isArchived isInOrganization stargazerCount}\n}\n```\n\n* Run the query\n```\ncurl -v -H \"Authorization: Bearer $GITHUB_TOKEN\" -d \"$( echo '{}' | jq --arg query \"$(\u003cquery.graphql)\" '. + {query: $query}' )\" https://api.github.com/graphql\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvob%2Fgo-project-usage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdvob%2Fgo-project-usage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvob%2Fgo-project-usage/lists"}