{"id":21292035,"url":"https://github.com/johnnythetank/angular-openweathermap-api-factory","last_synced_at":"2026-03-07T18:04:24.683Z","repository":{"id":57178868,"uuid":"47878345","full_name":"JohnnyTheTank/angular-openweathermap-api-factory","owner":"JohnnyTheTank","description":"AngularJS Factory for OpenWeatherMap JSON REST API requests","archived":false,"fork":false,"pushed_at":"2016-09-25T20:27:15.000Z","size":17,"stargazers_count":10,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-08T20:17:53.652Z","etag":null,"topics":["angular","angular-factory","angularjs","api","factory","openweathermap","openweathermap-api","weather"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/JohnnyTheTank.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":"2015-12-12T13:01:20.000Z","updated_at":"2022-01-17T00:09:22.000Z","dependencies_parsed_at":"2022-09-09T17:11:54.612Z","dependency_job_id":null,"html_url":"https://github.com/JohnnyTheTank/angular-openweathermap-api-factory","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnnyTheTank%2Fangular-openweathermap-api-factory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnnyTheTank%2Fangular-openweathermap-api-factory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnnyTheTank%2Fangular-openweathermap-api-factory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnnyTheTank%2Fangular-openweathermap-api-factory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JohnnyTheTank","download_url":"https://codeload.github.com/JohnnyTheTank/angular-openweathermap-api-factory/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225741250,"owners_count":17516895,"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":["angular","angular-factory","angularjs","api","factory","openweathermap","openweathermap-api","weather"],"created_at":"2024-11-21T13:47:16.699Z","updated_at":"2026-03-07T18:04:24.642Z","avatar_url":"https://github.com/JohnnyTheTank.png","language":"JavaScript","readme":"**angular-openweathermap-api-factory** is an angularjs module with a [OpenWeatherMap](http://openweathermap.org/) API promise factory.\n\n[![npm version](https://badge.fury.io/js/angular-openweathermap-api-factory.svg)](https://badge.fury.io/js/angular-openweathermap-api-factory)\n[![Bower version](https://badge.fury.io/bo/angular-openweathermap-api-factory.svg)](https://badge.fury.io/bo/angular-openweathermap-api-factory)\n\nAuthor: Jonathan Hornung ([JohnnyTheTank](https://github.com/JohnnyTheTank))\n\n## Usage\n\n1. Install via either [bower](http://bower.io/), [npm](https://www.npmjs.com/) or downloaded files:\n    1. `bower install --save angular-openweathermap-api-factory`\n    2. `npm install --save angular-openweathermap-api-factory`\n    3. download [angular-openweathermap-api-factory.zip](https://github.com/JohnnyTheTank/angular-openweathermap-api-factory/zipball/master)\n2. Include dependencies in your HTML.\n    1. When using bower:\n    ```html\n    \u003cscript src=\"bower_components/angular-openweathermap-api-factory/dist/angular-openweathermap-api-factory.min.js\"\u003e\u003c/script\u003e\n    ```\n    2. When using npm:\n    ```html\n    \u003cscript src=\"node_modules/angular-openweathermap-api-factory/dist/angular-openweathermap-api-factory.min.js\"\u003e\u003c/script\u003e\n    ```\n    3. when using downloaded files\n    ```html\n    \u003cscript src=\"angular-openweathermap-api-factory.min.js\"\u003e\u003c/script\u003e\n    ```  \n3. Add **`jtt_openweathermap`** to your application's module dependencies.\n4. Use the factory `openweathermapFactory`\n\n\n## factory methods\n\n### current weather\n\n#### current weather from city by name\n```js\n// docs: http://openweathermap.org/current#name\nopenweathermapFactory.getWeatherFromCitySearchByName({\n    q:\"\u003cCITY_NAME\u003e,\u003cCOUNTRY_CODE\u003e\", //city name and country code divided by comma, use ISO 3166 country codes eg \"London,uk\"\n    lang:\"\u003cLANGUAGE\u003e\", // (optional) http://openweathermap.org/current#multi\n    units:\"\u003cUNITS\u003e\", // (optinal) http://openweathermap.org/current#data\n    type:\"\u003cTYPE\u003e\", // (optional) 'like' = close result, 'accurate' = accurate result\n    appid:\"\u003cAPP_ID\u003e\"\n}).then(function(_data){\n    //on success\n}).catch(function (_data) {\n    //on error\n});\n```\n\n#### current weather from city by id\n```js\n// docs: http://openweathermap.org/current#cityid\nopenweathermapFactory.getWeatherFromCityById({\n    id:\"\u003cCITY_ID\u003e\", //List of city ID can be downloaded here http://bulk.openweathermap.org/sample/city.list.json.gz\n    lang:\"\u003cLANGUAGE\u003e\", // (optional) http://openweathermap.org/current#multi\n    units:\"\u003cUNITS\u003e\", // (optinal) http://openweathermap.org/current#data\n    appid:\"\u003cAPP_ID\u003e\"\n}).then(function(_data){\n    //on success\n}).catch(function (_data) {\n    //on error\n});\n```\n\n#### current weather from group of cities by id\n```js\n// docs: http://openweathermap.org/current#severalid\nopenweathermapFactory.getWeatherFromGroupOfCitiesById({\n    id:\"\u003cCITY_ID\u003e,\u003cCITY_ID\u003e,\u003cCITY_ID\u003e,...\", //List of city ID can be downloaded here http://bulk.openweathermap.org/sample/city.list.json.gz\n    lang:\"\u003cLANGUAGE\u003e\", // (optional) http://openweathermap.org/current#multi\n    units:\"\u003cUNITS\u003e\", // (optinal) http://openweathermap.org/current#data\n    appid:\"\u003cAPP_ID\u003e\"\n}).then(function(_data){\n    //on success\n}).catch(function (_data) {\n    //on error\n});\n```\n\n#### current weather from location by coordinates\n```js\n// docs: http://openweathermap.org/current#geo\nopenweathermapFactory.getWeatherFromLocationByCoordinates({\n    lat:\"\u003cLAT\u003e\",\n    lon:\"\u003cLONG\u003e\",\n    lang:\"\u003cLANGUAGE\u003e\", // (optional) http://openweathermap.org/current#multi\n    units:\"\u003cUNITS\u003e\", // (optinal) http://openweathermap.org/current#data\n    appid:\"\u003cAPP_ID\u003e\"\n}).then(function(_data){\n    //on success\n}).catch(function (_data) {\n    //on error\n});\n```\n\n#### current weather from location by zipcode\n```js\n// docs: http://openweathermap.org/current#zip\nopenweathermapFactory.getWeatherFromLocationByCoordinates({\n    zip:\"\u003cZIPCODE\u003e,\u003cCOUNTRY_CODE\u003e\", //use ISO 3166 country codes\n    lang:\"\u003cLANGUAGE\u003e\", // http://openweathermap.org/current#multi\n    units:\"\u003cUNITS\u003e\", // (optinal) http://openweathermap.org/current#data\n    appid:\"\u003cAPP_ID\u003e\"\n}).then(function(_data){\n    //on success\n}).catch(function (_data) {\n    //on error\n});\n```\n\n### 5-day-forecast\n\n#### 5-day-forecast from city by name\n```js\n// docs: http://openweathermap.org/forecast5#name5\nopenweathermapFactory.cityForecast5SearchByName({\n    q:\"\u003cCITY_NAME\u003e,\u003cCOUNTRY_CODE\u003e\", //city name and country code divided by comma, use ISO 3166 country codes eg \"London,uk\"\n    lang:\"\u003cLANGUAGE\u003e\", // (optional) http://openweathermap.org/current#multi\n    units:\"\u003cUNITS\u003e\", // (optinal) http://openweathermap.org/current#data\n    type:\"\u003cTYPE\u003e\", // (optional) 'like' = close result, 'accurate' = accurate result\n    appid:\"\u003cAPP_ID\u003e\"\n}).then(function(_data){\n    //on success\n}).catch(function (_data) {\n    //on error\n});\n```\n\n#### 5-day-forecast from city by id\n```js\n// docs: http://openweathermap.org/forecast5#cityid5\nopenweathermapFactory.getForecast5FromCityById({\n    id:\"\u003cCITY_ID\u003e\", //List of city ID can be downloaded here http://bulk.openweathermap.org/sample/city.list.json.gz\n    lang:\"\u003cLANGUAGE\u003e\", // (optional) http://openweathermap.org/current#multi\n    units:\"\u003cUNITS\u003e\", // (optinal) http://openweathermap.org/current#data\n    appid:\"\u003cAPP_ID\u003e\"\n}).then(function(_data){\n    //on success\n}).catch(function (_data) {\n    //on error\n});\n```\n\n#### 5-day-forecast from location by coordinates\n```js\n// docs: http://openweathermap.org/forecast5#geo5\nopenweathermapFactory.getForecast5FromLocationByCoordinates({\n    lat:\"\u003cLAT\u003e\",\n    lon:\"\u003cLONG\u003e\",\n    lang:\"\u003cLANGUAGE\u003e\", // (optional) http://openweathermap.org/current#multi\n    units:\"\u003cUNITS\u003e\", // (optinal) http://openweathermap.org/current#data\n    appid:\"\u003cAPP_ID\u003e\"\n}).then(function(_data){\n    //on success\n}).catch(function (_data) {\n    //on error\n});\n```\n\n\n## OpenWeatherMap JSON API\n* docs: http://openweathermap.org/api\n\n## More angular-api-factories\n[bandsintown](https://github.com/JohnnyTheTank/angular-bandsintown-api-factory) - [dailymotion](https://github.com/JohnnyTheTank/angular-dailymotion-api-factory) - [facebook](https://github.com/JohnnyTheTank/angular-facebook-api-factory) - [flickr](https://github.com/JohnnyTheTank/angular-flickr-api-factory) - [footballdata](https://github.com/JohnnyTheTank/angular-footballdata-api-factory) - [github](https://github.com/JohnnyTheTank/angular-github-api-factory) - **openweathermap** - [tumblr](https://github.com/JohnnyTheTank/angular-tumblr-api-factory) - [vimeo](https://github.com/JohnnyTheTank/angular-vimeo-api-factory) - [wikipedia](https://github.com/JohnnyTheTank/angular-wikipedia-api-factory) - [youtube](https://github.com/JohnnyTheTank/angular-youtube-api-factory)\n\n## License\n\nMIT","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnnythetank%2Fangular-openweathermap-api-factory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnnythetank%2Fangular-openweathermap-api-factory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnnythetank%2Fangular-openweathermap-api-factory/lists"}