{"id":18078358,"url":"https://github.com/techgaun/ex_nrel","last_synced_at":"2025-10-30T04:53:30.507Z","repository":{"id":62429238,"uuid":"70955435","full_name":"techgaun/ex_nrel","owner":"techgaun","description":"NREL(https://developer.nrel.gov/) Api client for Elixir ","archived":false,"fork":false,"pushed_at":"2018-07-12T14:49:56.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T20:41:26.184Z","etag":null,"topics":["elixir","nrel","solar"],"latest_commit_sha":null,"homepage":"https://developer.nrel.gov/","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/techgaun.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":"2016-10-15T00:05:03.000Z","updated_at":"2018-07-12T14:49:58.000Z","dependencies_parsed_at":"2022-11-01T20:03:21.961Z","dependency_job_id":null,"html_url":"https://github.com/techgaun/ex_nrel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/techgaun/ex_nrel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techgaun%2Fex_nrel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techgaun%2Fex_nrel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techgaun%2Fex_nrel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techgaun%2Fex_nrel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/techgaun","download_url":"https://codeload.github.com/techgaun/ex_nrel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techgaun%2Fex_nrel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271754942,"owners_count":24815323,"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-23T02:00:09.327Z","response_time":69,"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":["elixir","nrel","solar"],"created_at":"2024-10-31T12:13:41.942Z","updated_at":"2025-10-30T04:53:25.460Z","avatar_url":"https://github.com/techgaun.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExNrel\n\n[![Build Status](https://semaphoreci.com/api/v1/techgaun/ex_nrel/branches/master/badge.svg)](https://semaphoreci.com/techgaun/ex_nrel) [![Hex version](https://img.shields.io/hexpm/v/ex_nrel.svg \"Hex version\")](https://hex.pm/packages/ex_nrel) ![Hex downloads](https://img.shields.io/hexpm/dt/ex_nrel.svg \"Hex downloads\")\n\n\u003e NREL(https://developer.nrel.gov/) Api client for Elixir\n\n## Installation\n\nYou can install it from hex as below:\n\n- Add `ex_nrel` to your list of dependencies in `mix.exs`:\n\n  ```elixir\n  def deps do\n    [{:ex_nrel, \"~\u003e 0.2.0\"}]\n  end\n  ```\n\n- Ensure `ex_nrel` is started before your application:\n\n  ```elixir\n  def application do\n  [applications: [:ex_nrel]]\n  end\n  ```\n\n## Usage\n\n### Configuration\n\nIn your configuration, add the following block:\n\n```\nconfig :ex_nrel,\n  api_key: System.get_env(\"NREL_API_KEY\"),\n  format: \"json\"\n```\n\nOutput can be either `json` or `xml`. You can also specify `format` as part of your queries in any of the API calls to get the data of specific format. For example, `ExNrel.Electricity.UtilityRate.get(lat: 39.323, lon: -94.23, format: \"json\")` explicitly returns `json` overriding the default configuration.\n\nExNrel supports following APIs offered by NREL.\n\n### [Buildings](http://developer.nrel.gov/docs/buildings/)\n\n#### [Commerial Building Resources](http://developer.nrel.gov/docs/buildings/commercial-building-resource-database-v1/) (resources, events and vocabularies)\n\n```elixir\niex\u003e ExNrel.Buildings.CBR.get(portal: \"Energy\")\n\niex\u003e ExNrel.Buildings.CBR.events(portal: 5)\n\niex\u003e ExNrel.Buildings.CBR.vocabularies(name: \"audience-types\")\n```\n\n### [Electricity](http://developer.nrel.gov/docs/electricity/)\n\n#### [Energy Incentives (Version 2)](http://developer.nrel.gov/docs/electricity/energy-incentives-v2/)\n\n```elixir\niex\u003e ExNrel.Electricity.EnergyIncentives.get(lat: 39.323, lon: -94.23)\n\niex\u003e ExNrel.Electricity.EnergyIncentives.get(lat: 39.323, lon: -94.23, category: \"hvac\")\n\niex\u003e ExNrel.Electricity.EnergyIncentives.get(lat: 39.323, lon: -94.23, category: \"hvac\", technology: \"air_conditioners\")\n\niex\u003e ExNrel.Electricity.EnergyIncentives.get(address: \"1712 Main Street, Kansas City\")\n```\n\n#### [Utility Rates](http://developer.nrel.gov/docs/electricity/utility-rates-v3/)\n\n```elixir\niex\u003e ExNrel.Electricity.UtilityRate.get(lat: 39.323, lon: -94.23)\n\niex\u003e ExNrel.Electricity.UtilityRate.get(address: \"1712 Main Street, Kansas City\")\n```\n\n#### [Utility Rates by Census Region](http://developer.nrel.gov/docs/electricity/census-rate-v3/)\n\n```elixir\niex\u003e ExNrel.Electricity.CensusRate.get(id: 101, lat: 39.323, lon: -94.23)\n\niex\u003e ExNrel.Electricity.CensusRate.get(id: 101, address: \"1712 Main Street, Kansas City\")\n```\n\n### [Solar](http://developer.nrel.gov/docs/solar/)\n\n#### [PVWatts (Version 5)](https://developer.nrel.gov/docs/solar/pvwatts-v5/)\n\n```elixir\niex\u003e ExNrel.Solar.PVWatts.get(lat: 39.323, lon: -94.23)\n\niex\u003e ExNrel.Solar.PVWatts.get(address: \"1712 Main Street, Kansas City\")\n\niex\u003e ExNrel.Solar.PVWatts.get(lat: 39.323, lon: -94.23, timeframe: \"hourly\")\n```\n\n#### [Solar Dataset Query](http://developer.nrel.gov/docs/solar/data-query-v1/)\n\n```elixir\niex\u003e ExNrel.Solar.Dataset.get(lat: 39.323, lon: -94.23, radius: 20)\n\niex\u003e ExNrel.Solar.Dataset.get(address: \"1712 Main Street, Kansas City\")\n\niex\u003e ExNrel.Solar.Dataset.get(lat: 39.323, lon: -94.23, all: 1)\n```\n\n#### [Solar Resource Data](http://developer.nrel.gov/docs/solar/solar-resource-v1/)\n\n```elixir\niex\u003e ExNrel.Solar.Resources.get(lat: 39.323, lon: -94.23)\n\niex\u003e ExNrel.Solar.Resources.get(address: \"1712 Main Street, Kansas City\")\n```\n\n### API Response\n\nThe response from the API is parsed through a simple parser. For JSON, the `poison` package does the job and for XML, currently ExNrel returns the body as string.\n\nThe response can be one of:\n\n```elixir\n{:ok, body, [total_limit: api_rate_limit, remaining_limit: api_remaining_limit]}\n\n{:error, %{reason: \"failure_reason\"}}\n```\n\n## Contribution\n\n- You can add support for remaining APIs or fix the bug in existing ones.\n- ~~The XML parsing is not in-place.~~\n- ~~Rate limiting headers might be useful to handle rate limiting issues.~~ (Part of response in ExNrel \u003e= 0.2.0)\n\n## Author\n\n- [techgaun](https://github.com/techgaun)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechgaun%2Fex_nrel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechgaun%2Fex_nrel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechgaun%2Fex_nrel/lists"}