{"id":26127769,"url":"https://github.com/kwabenberko/news-api-java","last_synced_at":"2026-03-04T02:02:45.063Z","repository":{"id":37898816,"uuid":"134105387","full_name":"KwabenBerko/News-API-Java","owner":"KwabenBerko","description":"An wrapper for newsapi.org","archived":false,"fork":false,"pushed_at":"2025-01-27T09:48:27.000Z","size":151,"stargazers_count":32,"open_issues_count":4,"forks_count":15,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-18T18:24:46.938Z","etag":null,"topics":["android","android-library","java","java-library","newsapi","newsapi-android-library","newsapi-java-library","newsapi-python","retrofit2","wrapper","wrapper-api","wrapper-library"],"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/KwabenBerko.png","metadata":{"files":{"readme":"README.md","changelog":"newsapilib/.gitignore","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-05-19T23:33:32.000Z","updated_at":"2025-09-01T16:26:16.000Z","dependencies_parsed_at":"2025-03-12T04:00:46.020Z","dependency_job_id":null,"html_url":"https://github.com/KwabenBerko/News-API-Java","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/KwabenBerko/News-API-Java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KwabenBerko%2FNews-API-Java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KwabenBerko%2FNews-API-Java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KwabenBerko%2FNews-API-Java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KwabenBerko%2FNews-API-Java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KwabenBerko","download_url":"https://codeload.github.com/KwabenBerko/News-API-Java/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KwabenBerko%2FNews-API-Java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30069235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T01:03:42.280Z","status":"online","status_checked_at":"2026-03-04T02:00:07.464Z","response_time":59,"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":["android","android-library","java","java-library","newsapi","newsapi-android-library","newsapi-java-library","newsapi-python","retrofit2","wrapper","wrapper-api","wrapper-library"],"created_at":"2025-03-10T18:37:34.602Z","updated_at":"2026-03-04T02:02:45.045Z","avatar_url":"https://github.com/KwabenBerko.png","language":"Java","readme":"## News-API-Java\n\n**Create an account at [newsapi.org](https://newsapi.org/) to get your API key.**\n\n\n## Download\n\n### Using Gradle\n\n#### Step 1. Add the JitPack repository to your root ```build.gradle``` file.\n\n``` java\nallprojects {\n  repositories {\n    ...\n    maven { url 'https://jitpack.io' }\n  }\n}\n```\n\n#### Step 2 : Download via ```Gradle```:\n\n```java\nimplementation 'com.github.KwabenBerko:News-API-Java:1.0.2'\n```\n\n### Using Maven\n\n#### Step 1. Add the JitPack repository to your ```pom.xml``` file.\n\n``` java\n\u003crepositories\u003e\n  \u003crepository\u003e\n    \u003cid\u003ejitpack.io\u003c/id\u003e\n    \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n  \u003c/repository\u003e\n\u003c/repositories\u003e\n```\n\n#### Step 2 : Add the dependency to the dependencies in your ```pom.xml``` file:\n\n```java\n\u003cdependencies\u003e\n  ...\n  ...\n  \u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.KwabenBerko\u003c/groupId\u003e\n    \u003cartifactId\u003eNews-API-Java\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.2\u003c/version\u003e\n  \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\n## Usage\n\n#### Instantiate the NewsApiClient class:\n\n``` java \nNewsApiClient newsApiClient = new NewsApiClient(\"YOUR_API_KEY\");\n```\n\n#### Get Top Headlines\n\n```java\nnewsApiClient.getTopHeadlines(\n                new TopHeadlinesRequest.Builder()\n                        .q(\"bitcoin\")\n                        .language(\"en\")\n                        .build(),\n                new NewsApiClient.ArticlesResponseCallback() {\n                    @Override\n                    public void onSuccess(ArticleResponse response) {\n                        System.out.println(response.getArticles().get(0).getTitle());\n                    }\n\n                    @Override\n                    public void onFailure(Throwable throwable) {\n                       System.out.println(throwable.getMessage());\n                    }\n                }\n        );\n```\n\n#### Get Everything\n\n```java\nnewsApiClient.getEverything(\n                new EverythingRequest.Builder()\n                        .q(\"trump\")\n                        .build(),\n                new NewsApiClient.ArticlesResponseCallback() {\n                    @Override\n                    public void onSuccess(ArticleResponse response) {\n                        System.out.println(response.getArticles().get(0).getTitle());\n                    }\n\n                    @Override\n                    public void onFailure(Throwable throwable) {\n                        System.out.println(throwable.getMessage());\n                    }\n                }\n        );\n```\n\n#### Get Sources\n```java\nnewsApiClient.getSources(\n                new SourcesRequest.Builder()\n                        .language(\"en\")\n                        .country(\"us\")\n                        .build(),\n                new NewsApiClient.SourcesCallback() {\n                    @Override\n                    public void onSuccess(SourcesResponse response) {\n                        System.out.println(response.getSources().get(0).getName());\n                    }\n\n                    @Override\n                    public void onFailure(Throwable throwable) {\n                        System.out.println(throwable.getMessage());\n                    }\n                }\n        );\n```\n\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwabenberko%2Fnews-api-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkwabenberko%2Fnews-api-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwabenberko%2Fnews-api-java/lists"}