{"id":25728363,"url":"https://github.com/kenjij/darksky-ruby","last_synced_at":"2026-06-07T20:31:39.984Z","repository":{"id":62556712,"uuid":"97740842","full_name":"kenjij/darksky-ruby","owner":"kenjij","description":"Pure simple Ruby based Dark Sky API gem","archived":false,"fork":false,"pushed_at":"2019-09-09T23:24:21.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-02-11T01:21:56.465Z","etag":null,"topics":["api","darksky","gem","ruby","weather"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/kenjij.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":"2017-07-19T16:56:39.000Z","updated_at":"2019-09-09T23:24:24.000Z","dependencies_parsed_at":"2022-11-03T06:15:19.026Z","dependency_job_id":null,"html_url":"https://github.com/kenjij/darksky-ruby","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/kenjij/darksky-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjij%2Fdarksky-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjij%2Fdarksky-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjij%2Fdarksky-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjij%2Fdarksky-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kenjij","download_url":"https://codeload.github.com/kenjij/darksky-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjij%2Fdarksky-ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34037777,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-07T02:00:07.652Z","response_time":124,"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":["api","darksky","gem","ruby","weather"],"created_at":"2025-02-26T00:17:32.878Z","updated_at":"2026-06-07T20:31:39.942Z","avatar_url":"https://github.com/kenjij.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# darksky-ruby\n\n[![Gem Version](https://badge.fury.io/rb/darksky-ruby.svg)](http://badge.fury.io/rb/darksky-ruby) [![Maintainability](https://api.codeclimate.com/v1/badges/2806310071f132379085/maintainability)](https://codeclimate.com/github/kenjij/darksky-ruby/maintainability)\n\nPure simple Ruby based [Dark Sky API](https://darksky.net/dev/) gem\n\n## Install\n\n```\n$ gem install darksky-ruby\n```\n\n## Use\n\n### [Forecast Request](https://darksky.net/dev/docs#forecast-request)\n\nExample of querying weather forecast for [SFO](https://www.airport-sfo.com/).\n\n```ruby\nrequire 'darksky-ruby'\n\napi = DarkSkyAPI.new(key: 'Your_Dark_Sky_API_Secret_Key')\ndata = api.forecast(lat: 37.6211, lon: -122.383)\np data[:hourly][:summary]\n# =\u003e \"Partly cloudy throughout the day.\"\n```\n\n### [Time Machine Request](https://darksky.net/dev/docs#time-machine-request)\n\nRequesting observed weather for noon of Jan. 1, 2018 at SFO.\n\n```ruby\ndata = api.timemachine(lat: 37.6211, lon: -122.383, ts: Time.new(2018,1,1,12))\np data[:currently][:temperature]\n# =\u003e 57.56\n```\n\n### [Response Format](https://darksky.net/dev/docs#response-format)\n\n`data` in above examples would contain a Ruby Hash of the entire API response; all keys are symbolized.\n\n### Options\n\nYou can limit the response data size by excluding unnecessary blocks.\n\n```ruby\napi.blocks = {minutely: false, hourly: false} # excludes blocks marked false\napi.include_only([:currently, :alerts]) # excludes everything except specified\napi.blocks\n# =\u003e {:currently=\u003etrue, :minutely=\u003efalse, :hourly=\u003efalse, :daily=\u003efalse,\n#     :alerts=\u003etrue, :flags=\u003efalse}\n```\n\nHint, you can use `api.blocks` first to get a default Hash to get started. After you've modified the Hash, you can save it with `api.blocks =`.\n\nOther options can be set like so.\n\n```ruby\napi.options = {lang: 'es', units: 'si'} # Spanish language, SI units\ndata = api.timemachine(lat: 37.6211, lon: -122.383, ts: Time.new(2018,1,1,12))\np data[:currently][:summary]\n# =\u003e \"Parcialmente Nublado\"\np data[:currently][:temperature]\n# =\u003e 14.2\n```\n\n## CLI\n\nThis gem includes an executable as an example.\n\n```\n$ darksky -h\ndarksky [options] \u003cLAT,LON\u003e\n  -k, --key=\u003cs\u003e     API secret key\n  -l, --loc=\u003cs\u003e     Location (latitude,longtitude)\n  -o, --log=\u003cs\u003e     Log file\n  -t, --time=\u003cs\u003e    Timestamp for Time Machine request\n  -v, --verbose     Verbose mode\n  -h, --help        Show this message\n```\n\n## More\n\nSince this is a simple gem with no external dependencies, you can directly include the `lib` contents in your project if you prefer not to use Ruby Gems, such as in [AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/ruby-package.html). If you do, be sure to include my copyright and license details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenjij%2Fdarksky-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkenjij%2Fdarksky-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenjij%2Fdarksky-ruby/lists"}