{"id":18370233,"url":"https://github.com/mielek/openweathermap-api-client","last_synced_at":"2025-10-06T23:04:56.010Z","repository":{"id":158265804,"uuid":"129561772","full_name":"Mielek/openweathermap-api-client","owner":"Mielek","description":"The OpenWeatherMap API client library provides an access to weather information's for Java EE applications.","archived":false,"fork":false,"pushed_at":"2018-04-15T15:19:45.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-06T23:03:55.126Z","etag":null,"topics":["javaee","openweathermap","openweathermap-api","rest-client"],"latest_commit_sha":null,"homepage":"","language":"Java","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/Mielek.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-14T23:25:31.000Z","updated_at":"2018-04-15T15:19:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"42ece060-97dc-421c-90ae-527dad7d58ac","html_url":"https://github.com/Mielek/openweathermap-api-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Mielek/openweathermap-api-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mielek%2Fopenweathermap-api-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mielek%2Fopenweathermap-api-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mielek%2Fopenweathermap-api-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mielek%2Fopenweathermap-api-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mielek","download_url":"https://codeload.github.com/Mielek/openweathermap-api-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mielek%2Fopenweathermap-api-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278692948,"owners_count":26029408,"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-10-06T02:00:05.630Z","response_time":65,"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":["javaee","openweathermap","openweathermap-api","rest-client"],"created_at":"2024-11-05T23:37:36.058Z","updated_at":"2025-10-06T23:04:55.959Z","avatar_url":"https://github.com/Mielek.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenWeatherMap API client project\n\nThe OpenWeatherMap API client library provides an access to weather information's for Java EE applications.\nIt uses 2.5 version of API. Library is using REST client specified in JAX-RS 2.1 specification.\nOpenWeatherMap client to properly function requires the client with registered JSON unmarshaller.\nUnmarshaller need to be compatible with Jaxb specification.\n\n## User Guide\n\n### Installation \u0026 Compilation\nLibrary installation require:\n- Java 8+\n- JAVA_PATH set to jdk location\n- Maven 3+\n- PATH need to contain maven location\n\nInstallation steps:\n```sh\ngit clone https://github.com/Mielek/openweathermap-api-client.git\ncd openweathermap-api-client\nmvn clean install -DskipTests\n```\nProject does not contain OpenWeatherMap api key that's why invoking maven require `-DskipTests`.\nHow to prepare project for running JUnit tests is described in [this](#invoking-project-tests) section.\n\n### Usage\n\nAdd maven dependency to your project.\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.mielek\u003c/groupId\u003e\n    \u003cartifactId\u003eopenweathermap-api-client\u003c/artifactId\u003e\n    \u003cversion\u003e0.0.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nThe `OpenWeatherMapClient` is available under `com.github.mielek.api.client.openweathermap` package.\n\nSimple main example:\n```java\nclass Main {\n    public static void main() {\n        Client webClient = ClientBuilder.newClient().register(JacksonJaxbJsonProvider.class);\n        OpenWeatherMapClient weatherClient = new OpenWeatherMapClient(webClient, \"\u003c\u003cYOUR_API_KEY\u003e\u003e\");\n        try {\n            CityWeather cityWeather = weatherClient.getCurrentWeatherByCity(\"New York\");\n            System.out.println(cityWeather);\n        } catch (OpenWeatherMapApiException e) {\n            System.err.println(e.getMessage());\n        }\n    }\n}\n```\nRemember that you need to provide implementation of `javax.ws.rs.client.Client` in your project.\nYou can use for example apache cxf JAX-RS client.\nAdditionally you need to remember to register a JSON unmarshaller in the client to properly deserialize data received from the API.\nIn the example above Jackson implementation of Jaxb JSON unmarshaller is used.\n\n### Invoking project tests\n\nTo invoke tests shipped with the project you need to acquire OpenWeatherApi key.\n\nNext you need to create `openweathermap-api-key` file in the project root directory and fill it with your api key. For example:\n\n```sh\necho \"\u003c\u003cYOUR_KEY\u003e\u003e\" \u003e openweathermap-api-key\n```\n\nFollowing command will compile project and invoke some simple tests.\nThey will check if client with your api key is working correctly.\n\n```sh\nmvn test\n```\n\n## Credits\n\nCreated by Rafal Mielowski\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmielek%2Fopenweathermap-api-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmielek%2Fopenweathermap-api-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmielek%2Fopenweathermap-api-client/lists"}