{"id":21062744,"url":"https://github.com/niyiomotoso/the-guardian-api-java-client","last_synced_at":"2025-03-14T01:16:41.337Z","repository":{"id":183302333,"uuid":"669895366","full_name":"niyiomotoso/the-guardian-api-java-client","owner":"niyiomotoso","description":"Java client library for TheGuardian APIs","archived":false,"fork":false,"pushed_at":"2023-10-12T09:09:38.000Z","size":69,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-20T20:41:19.916Z","etag":null,"topics":["api","client-library","java","java-library","java-sdk","news-sdk","news-search","the-guardian-api","theguardian","theguardian-client-library"],"latest_commit_sha":null,"homepage":"","language":"Java","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/niyiomotoso.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":"2023-07-23T19:23:30.000Z","updated_at":"2023-08-11T21:37:49.000Z","dependencies_parsed_at":"2025-01-20T20:38:53.875Z","dependency_job_id":"23218c71-3b24-426b-8d40-c3c3952e1f93","html_url":"https://github.com/niyiomotoso/the-guardian-api-java-client","commit_stats":null,"previous_names":["niyiomotoso/the-guardian-api-java-client"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niyiomotoso%2Fthe-guardian-api-java-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niyiomotoso%2Fthe-guardian-api-java-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niyiomotoso%2Fthe-guardian-api-java-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niyiomotoso%2Fthe-guardian-api-java-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niyiomotoso","download_url":"https://codeload.github.com/niyiomotoso/the-guardian-api-java-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243505960,"owners_count":20301619,"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":["api","client-library","java","java-library","java-sdk","news-sdk","news-search","the-guardian-api","theguardian","theguardian-client-library"],"created_at":"2024-11-19T17:42:22.526Z","updated_at":"2025-03-14T01:16:41.312Z","avatar_url":"https://github.com/niyiomotoso.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The Guardian API Java Client\n\nJava client library for the Guardian APIs. See documentation [here](https://open-platform.theguardian.com/documentation/).\nAll available API modules are supported - Content, Tags, Sections, Editions, and Single Item.\n\n### Installation\nIt is installable with any of the jvm package managers such as Gradle, Maven, sbt e.t.c.\n\nExample gradle command:\n\n```java\nimplementation 'io.github.niyiomotoso:the-guardian-api-java-client:1.1.0'\n```\n\n### Get API key\n\nSign up for an API key [here](https://open-platform.theguardian.com/access)\n\n### Making Requests\n\nThe primary `Client\\GuardianApi` class is a factory class that creates objects for each of the API modules, allowing you to make requests to any of them with your desired request parameters. You have to first create an object for it, then access your desired API module via the object. See the code snippets below:\n\n```java\n GuardianApi guardianApi = this.guardianApi = new GuardianApi(THE_GUARDIAN_API_KEY);\n```\n\n**For Content:**\n\n```java\nContentResponse response = this.guardianApi.content().setQuery(\"12 years a slave\").setTag(\"film/film,tone/reviews\").setFromDate(\"2023-03-20\").setShowTags(\"contributor\").setShowFields(\"starRating,headline,thumbnail,short-url\").setOrderBy(\"relevance\").fetch();\n```\n\n**For Tags:**\n\n```java\nTagsResponse response = this.guardianApi.tags().setQuery(\"apple\").setSection(\"technology\").setShowReferences(\"all\").fetch();\n```\n\n**For Sections:**\n\n```java\nSectonsResponse response = tthis.guardianApi.sections().setQuery(\"business\").fetch();\n```\n\n**For Editions:**\n\n```java\nEditionsResponse response = this.guardianApi.editions().setQuery(\"uk\").fetch();\n```\n\n**For Single Item:**\n\n```java\nSingleItemResponse response = this.guardianApi.singleItem().setId(\"/sport/2022/oct/07/cricket-jos-buttler-primed-for-england-comeback-while-phil-salt-stays-focused\").setShowStoryPackage(true).setShowEditorsPicks(true).setShowMostViewed(true).setShowRelated(true).fetch();\n```\n\n### Community support\nYou can reach out to us on the Google Group here https://groups.google.com/g/guardian-api-talk for support \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniyiomotoso%2Fthe-guardian-api-java-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniyiomotoso%2Fthe-guardian-api-java-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniyiomotoso%2Fthe-guardian-api-java-client/lists"}