{"id":43916926,"url":"https://github.com/zooniverse/zoo-stats-api-graphql","last_synced_at":"2026-02-06T21:35:00.373Z","repository":{"id":33250721,"uuid":"151437978","full_name":"zooniverse/zoo-stats-api-graphql","owner":"zooniverse","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-18T22:43:30.000Z","size":28454,"stargazers_count":0,"open_issues_count":11,"forks_count":2,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-04-15T23:07:38.529Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/zooniverse.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}},"created_at":"2018-10-03T15:44:48.000Z","updated_at":"2021-10-15T10:34:40.000Z","dependencies_parsed_at":"2024-01-18T18:42:20.779Z","dependency_job_id":null,"html_url":"https://github.com/zooniverse/zoo-stats-api-graphql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zooniverse/zoo-stats-api-graphql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zooniverse%2Fzoo-stats-api-graphql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zooniverse%2Fzoo-stats-api-graphql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zooniverse%2Fzoo-stats-api-graphql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zooniverse%2Fzoo-stats-api-graphql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zooniverse","download_url":"https://codeload.github.com/zooniverse/zoo-stats-api-graphql/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zooniverse%2Fzoo-stats-api-graphql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29177555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T20:14:21.878Z","status":"ssl_error","status_checked_at":"2026-02-06T20:14:21.443Z","response_time":59,"last_error":"SSL_read: 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":["hacktoberfest"],"created_at":"2026-02-06T21:35:00.049Z","updated_at":"2026-02-06T21:35:00.365Z","avatar_url":"https://github.com/zooniverse.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zoo stats\n[![Build Status](https://travis-ci.org/zooniverse/zoo-stats-api-graphql.svg?branch=master)](https://travis-ci.org/zooniverse/zoo-stats-api-graphql)\n\n#### API\nThe stats service has a GraphQL API, https://graphql.org/ which differs to RESTful APIs.\n\nThere is only one endpoint path for this API `/graphql` and it only supports the `POST` HTTP method for the `application/json` content type.\n\n###### POST /graphql (application/json)\n\n**Introspect the available operations**\n\n```\ncurl -d '{\"query\": \"{__schema {queryType {name fields {name}}mutationType {name fields {name}}}}\"}' -H \"Content-Type: application/json\" -X POST https://graphql-stats.zooniverse.org/graphql\n```\n\n**Event type counts per interval**\nRetrieve the number of classifications for a specified event type for a known interval. Non-required attributes are `projectID` and `userId` to filter the results.\n\nNote: If you supply the the userId attribute you **must** provide a bearer token in the Authorization header, e.g.\n`Authorization: Bearer \u003cTOKEN\u003e`\n\nYou must supply and `eventType`, `interval` and `window`. Valid intervals are postgres intervals, e.g. `2 Days`, `24 Hours`, `60 Seconds`\nValid windows are postgres intervals, e.g. `7 Days`, `2 Weeks`, `1 Month`, `1 Year`.\n\n```\n{\n  statsCount(\n    eventType: \"classification\",\n    interval: \"1 Day\",\n    window: \"1 week\",\n    projectId: \"${project.id}\",\n    userId: \"${user.id}\"\n  ){\n    period,\n    count\n  }\n}\n```\n\nNote: `classification` events are currently the only supported event types.\n\n#### Getting Started\n\n1. Clone the repository `git clone https://github.com/zooniverse/zoo_stats_api_graphql`.\n\n0. Install Docker from the appropriate link above.\n\n0. `cd` into the cloned folder.\n\n0. Run `docker-compose build` to build the containers Panoptes API container. You will need to re-run this command on any changes to `Dockerfile.dev` (note the dev dockerfile, production is `Dockerfile`)\n\n0. Create and run the application containers with `docker-compose up`\n\n0. If the above step reports a missing database error, kill the docker-compose process or open a new terminal window in the current directory and then run `docker-compose run --rm zoo_stats bundle exec rake db:setup` to setup the database. This command will launch a new Docker container, run the rake DB setup task, and then clean up the container.\n\n0. Open up the application in your browser at http://localhost:3000\n\nOnce all the above steps complete you will have a working copy of the checked out code base. Keep your code up to date and rebuild the image on any code or configuration changes.\n\nNote: You will need to re-install the gem dependencies for the application if you modify the Gemfile\n    * Run: `docker-compose run --rm zoo_stats bundle install`\n\n#### Testing\n\n1. Setup the test environment and database\n    * Run: `docker-compose run --rm -e RAILS_ENV=test zoo_stats bundle exec rake db:setup`\n\n0. Run the tests\n    * Run: `docker-compose run -T --rm -e RAILS_ENV=test zoo_stats bundle exec rspec`\n\n0. Get a console to interactively run / debug tests\n    * Run: `docker-compose run --rm -e RAILS_ENV=test zoo_stats bash`\n    * Then in the container run: `bundle exec rspec`\n\n### Setup Docker and Docker Compose\n\n* Docker\n  * [OS X](https://docs.docker.com/installation/mac/) - Docker Machine\n  * [Ubuntu](https://docs.docker.com/installation/ubuntulinux/) - Docker\n  * [Windows](http://docs.docker.com/installation/windows/) - Boot2Docker\n\n* [Docker Compose](https://docs.docker.com/compose/)\n\n#### Thanks\n\nThis product includes GeoLite2 data created by MaxMind, available from http://www.maxmind.com.\n\n[![pullreminders](https://pullreminders.com/badge.svg)](https://pullreminders.com?ref=badge)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzooniverse%2Fzoo-stats-api-graphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzooniverse%2Fzoo-stats-api-graphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzooniverse%2Fzoo-stats-api-graphql/lists"}