{"id":28483184,"url":"https://github.com/rayshan/ga-extractor","last_synced_at":"2025-08-30T16:41:03.749Z","repository":{"id":23058922,"uuid":"26412263","full_name":"rayshan/ga-extractor","owner":"rayshan","description":"Free your Google Analytics data.","archived":false,"fork":false,"pushed_at":"2016-04-05T23:43:31.000Z","size":41,"stargazers_count":9,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-09T06:39:10.909Z","etag":null,"topics":["analytics","etl","google-analytics","google-api","nodejs"],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","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/rayshan.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}},"created_at":"2014-11-09T22:55:54.000Z","updated_at":"2021-04-01T16:38:54.000Z","dependencies_parsed_at":"2022-08-21T10:10:58.303Z","dependency_job_id":null,"html_url":"https://github.com/rayshan/ga-extractor","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/rayshan/ga-extractor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayshan%2Fga-extractor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayshan%2Fga-extractor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayshan%2Fga-extractor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayshan%2Fga-extractor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rayshan","download_url":"https://codeload.github.com/rayshan/ga-extractor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayshan%2Fga-extractor/sbom","scorecard":{"id":763722,"data":{"date":"2025-08-11","repo":{"name":"github.com/rayshan/ga-extractor","commit":"6c50aa79032f3e17fdf2d28f355a4d296879dd87"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/22 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-23T00:09:21.381Z","repository_id":23058922,"created_at":"2025-08-23T00:09:21.382Z","updated_at":"2025-08-23T00:09:21.382Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272878212,"owners_count":25008340,"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","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["analytics","etl","google-analytics","google-api","nodejs"],"created_at":"2025-06-07T21:07:31.166Z","updated_at":"2025-08-30T16:41:03.711Z","avatar_url":"https://github.com/rayshan.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ga-extractor [![Build Status](https://travis-ci.org/rayshan/ga-extractor.svg?branch=master)](https://travis-ci.org/rayshan/ga-extractor)\n\n\u003e Free your Google Analytics data\n\n`ga-extractor` bulk-extracts Google Analytics (GA) raw data using the [Core Reporting API](https://developers.google.com/analytics/devguides/reporting/core/v3/). Use it as part of your [ETL](http://en.wikipedia.org/wiki/Extract,_transform,_load) process.\n\n`ga-extractor` was spun off from [`bower-server-etl`](https://github.com/rayshan/bower-server-etl), the ETL service that feeds [Bower](http://bower.io/)'s registry.\n\n\n## Features\n\n- Compatible with latest GA Core Reporting API `v3`\n- Authorizes using OAuth 2.0 [Service Accounts](https://developers.google.com/accounts/docs/OAuth2ServiceAccount)\n- Promises\n- Will break large extractions into smaller queries based on GA's single query [limit](https://developers.google.com/analytics/devguides/reporting/core/v3/limits-quotas#core_reporting)\n- Well tested against live GA API server\n\n\n## Install\n\n```sh\nnpm install --save ga-extractor\n```\n\n\n## Usage\n\nSign up for a GA [Service Account](https://developers.google.com/accounts/docs/OAuth2ServiceAccount), download your `.p12` private key.\n\n```js\nvar gaExtractor = require('ga-extractor');\n\nvar options = {\n  clientEmail: \"x@developer.gserviceaccount.com\",\n  // need either keyPath or keyContent\n  keyPath: \"test/fixtures/xxx.p12\",\n  keyContent: \"Bag Attributes...\",\n  // below are optional\n  profileId: \"xxxxxxxx\", // define once here or define a different one in every queryObj\n  impersonatedUser: \"steve@apple.com\"\n  proxy: \"http://proxy.example.com\"\n};\n\nvar gaExtractor = new GaExtractor(options);\n\n// To build your query, see\n// https://developers.google.com/analytics/devguides/reporting/core/v3/reference#q_summary\n// and https://developers.google.com/analytics/devguides/reporting/core/v3/reference\nvar queryObj = {\n  'start-date': '31daysAgo',\n  'end-date': 'yesterday',\n  'metrics': 'ga:users',\n  'dimensions': 'ga:country'\n  // no need to define 'max-results', always extracts all data\n};\n\ngaExtractor.extract(queryObj)\n  .then(function (data) {\n    // do something with data returned, e.g. transform \u0026 load into database\n    data = [\n      [\"United States\", \"5471\"],\n      [\"United Kingdom\", \"1084\"],\n      [\"France\", \"801\"]\n      // ...\n    ];\n  })\n  .catch(console.error);\n```\n\nTo try your query without writing any code, use the [Query Explorer Tool](https://ga-dev-tools.appspot.com/explorer/).\n\nExample of original data returned by GA API:\n\n```json\n{\n  \"kind\": \"analytics#gaData\",\n  \"id\": \"...\",\n  \"query\": {\n    \"start-date\": \"7daysAgo\",\n    \"end-date\": \"yesterday\",\n    \"ids\": \"...\",\n    \"dimensions\": \"ga:country\",\n    \"metrics\": [\"ga:users\"],\n    \"sort\": [\"-ga:users\"],\n    \"start-index\": 1,\n    \"max-results\": 10000\n  },\n  \"itemsPerPage\": 10000,\n  \"totalResults\": 137,\n  \"selfLink\": \"...\",\n  \"profileInfo\": {\n    \"profileId\": \"...\",\n    \"accountId\": \"...\",\n    \"webPropertyId\": \"...\",\n    \"internalWebPropertyId\": \"...\",\n    \"profileName\": \"...\",\n    \"tableId\": \"...\"\n  },\n  \"containsSampledData\": false,\n  \"columnHeaders\": [],\n  \"totalsForAllResults\": {\n    \"ga:users\": \"17205\"\n  },\n  \"rows\": [\n    [\"United States\", \"5471\"],\n    [\"United Kingdom\", \"1084\"],\n    [\"France\", \"801\"]\n  ]\n}\n```\n\n`.extract` returns only the content of `rows` object above.\n\n\n## Contribution\n\nInstall dependencies: `npm install`\n\nEnsure tests pass: `npm test`\n\nTODO: all tests are integration tests and execute against live GA API server. Docs on fixtures needed for testing coming soon. In the mean time you can submit a PR and owner will manually test.\n\nBuild .js for distribution: `npm build`\n\n\n## License\n\nMIT © [Ray Shan](shan.io)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frayshan%2Fga-extractor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frayshan%2Fga-extractor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frayshan%2Fga-extractor/lists"}