{"id":37029762,"url":"https://github.com/google/java-photoslibrary","last_synced_at":"2026-01-14T03:35:35.907Z","repository":{"id":54538323,"uuid":"146525109","full_name":"google/java-photoslibrary","owner":"google","description":"Java client library for the Google Photos Library API","archived":false,"fork":false,"pushed_at":"2023-10-17T15:12:36.000Z","size":5768,"stargazers_count":115,"open_issues_count":13,"forks_count":58,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-12-31T18:18:08.875Z","etag":null,"topics":["google","google-photos","java"],"latest_commit_sha":null,"homepage":"http://developers.google.com/photos","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/google.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2018-08-29T00:57:49.000Z","updated_at":"2025-12-02T00:07:19.000Z","dependencies_parsed_at":"2025-08-19T19:35:54.893Z","dependency_job_id":"33961e0c-4ae8-4cb5-a77d-11c18b35bf6d","html_url":"https://github.com/google/java-photoslibrary","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/google/java-photoslibrary","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fjava-photoslibrary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fjava-photoslibrary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fjava-photoslibrary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fjava-photoslibrary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/java-photoslibrary/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fjava-photoslibrary/sbom","scorecard":{"id":437283,"data":{"date":"2025-08-11","repo":{"name":"github.com/google/java-photoslibrary","commit":"fe3e366c2264774d78f6ae684c5842803ca2c02b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 2/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: gradle/wrapper/gradle-wrapper.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v1.7.3 not signed: https://api.github.com/repos/google/java-photoslibrary/releases/105732844","Warn: release artifact v1.7.1 not signed: https://api.github.com/repos/google/java-photoslibrary/releases/50514657","Warn: release artifact v1.7.0 not signed: https://api.github.com/repos/google/java-photoslibrary/releases/48328686","Warn: release artifact v1.6.1 not signed: https://api.github.com/repos/google/java-photoslibrary/releases/37954948","Warn: release artifact v1.7.3 does not have provenance: https://api.github.com/repos/google/java-photoslibrary/releases/105732844","Warn: release artifact v1.7.1 does not have provenance: https://api.github.com/repos/google/java-photoslibrary/releases/50514657","Warn: release artifact v1.7.0 does not have provenance: https://api.github.com/repos/google/java-photoslibrary/releases/48328686","Warn: release artifact v1.6.1 does not have provenance: https://api.github.com/repos/google/java-photoslibrary/releases/37954948"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/google/.github/SECURITY.md:1","Info: Found linked content: github.com/google/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/google/.github/SECURITY.md:1","Info: Found text in security policy: github.com/google/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 5 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T04:58:36.192Z","repository_id":54538323,"created_at":"2025-08-19T04:58:36.192Z","updated_at":"2025-08-19T04:58:36.192Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408844,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"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":["google","google-photos","java"],"created_at":"2026-01-14T03:35:35.276Z","updated_at":"2026-01-14T03:35:35.889Z","avatar_url":"https://github.com/google.png","language":"Java","readme":"# Google Photos Library API Java Client Library\n\nThis repository contains the Java client library for the [Google Photos Library API](https://developers.google.com/photos).\n\n[![Build Status](https://travis-ci.org/google/java-photoslibrary.svg?branch=main)](https://travis-ci.org/google/java-photoslibrary)\n\n## Requirements and preparation\n\n* Java 1.8+\n* Gradle build system \u003e= 6.5.1 or Maven recommended.\n* OAuth 2.0 credentials configured for your project as [described below](#set-up-your-oauth2-credentials-for-java). (Note that to run the samples, use the \"*other*\" client type.)\n\n## Download the client library\n\nFirstly, download the library or include it in your build configuration. Then, set up OAuth 2.0 credentials to access the API.\n\nNext, you can follow the [samples](sample/) to see the client library in action.\n\n### Option 1: Gradle dependency\nTo use this library with Gradle, add the following dependency to your `build.gradle` file and replace `VERSION_NUMBER` \nwith the [latest available release](releases/)):\n```\nrepositories {\n    mavenCentral()\n}\ndependencies {\n    implementation 'com.google.photos.library:google-photos-library-client:VERSION_NUMBER'\n}\n```\n\n### Option 2: Maven dependency\nTo use this library with Maven, add the following to your Maven `pom.xml` file and replace `VERSION_NUMBER` with the\n[latest available release](releases/)):\n```\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.google.photos.library\u003c/groupId\u003e\n  \u003cartifactId\u003egoogle-photos-library-client\u003c/artifactId\u003e\n  \u003cversion\u003eVERSION_NUMBER\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Option 3: Download a release\nThe [releases page](https://github.com/google/java-photoslibrary/releases) contains different artifacts for each library release, including jar files.\n\n### Option 4: Clone the repository\n\nUse this method if you want to alter or contribute to this library (e.g., submitting pull requests) or wish to try our samples. When you clone the repository,  **all** files in this repository will be downloaded.\n\n1. Run `git clone https://github.com/google/java-photoslibrary.git` at\n   the command prompt.\n2. You'll get a **java-photoslibrary** directory. Navigate to it by running\n    `cd java-photoslibrary`.\n3. Open the `build.gradle` file in your IDE or run `./gradlew assemble` at the\n   command prompt to build the project. See `./gradlew tasks` to see available tasks\n\n## Set up your OAuth2 credentials for Java\n\nThe Google Photos Library API uses [OAuth2](https://oauth.net/2/) as the\nauthentication mechanism. Note that the Library API does not support service accounts.\n\nTo complete the “Enable the API” and “Configure OAuth2.0” steps in the below procedure, refer to the [get started guide in the developer documentation](https://developers.google.com/photos/library/guides/)\n\nFollow the below steps:\n1. Set up a Google developers project\n1. Enable the *Google Photos Library API* in your developer project\n1. Configure OAuth 2.0 credentials, including a callback URI\n1. Either download your OAuth credentials as a JSON file or note your client ID and secret.\n\nTo try out the samples in this repository, select \"*other*\" as the application type.\n\nThis client library works with the [Google Auth Library for Java](https://github.com/google/google-auth-library-java).\nSpecify your client OAuth configuration in the `CredentialsProvider` when creating the `PhotoLibrarySettings` for a `PhotosLibraryClient` object.\nSee the file `PhotosLibraryClientFactory.java` for an example on how to create\na new `PhotosLibraryClient` object with credentials from the Google Auth Library.\n\n## Sample usage\n\n### API calls\nHere's a short example that shows how to create a new album:\n\n```java\n// [START sample_usage]\n// Set up the Photos Library Client that interacts with the API\nPhotosLibrarySettings settings =\n     PhotosLibrarySettings.newBuilder()\n    .setCredentialsProvider(\n        FixedCredentialsProvider.create(/* Add credentials here. */)) \n    .build();\n\ntry (PhotosLibraryClient photosLibraryClient =\n    PhotosLibraryClient.initialize(settings)) {\n\n    // Create a new Album  with at title\n    Album createdAlbum = photosLibraryClient.createAlbum(\"My Album\");\n\n    // Get some properties from the album, such as its ID and product URL\n    String id = album.getId();\n    String url = album.getProductUrl();\n\n} catch (ApiException e) {\n    // Error during album creation\n}\n// [END sample_usage]\n```\n\nThe Google Photos Library API should be accessed via the `PhotosLibraryClient` class, which contains\nsome additional abstractions and utility methods. You should not use the underlying\n`InternalPhotosLibraryClient` and associated classes directly.\n\n### Google API Extensions\n\nThis library uses the [*Google API Extensions for Java (GAX Java)\nlibrary](https://github.com/googleapis/gax-java) for API access.\n\nIn particular, there are three ways of making calls to each of the API's methods:\n\n* A \"flattened\" method (recommended). With this type of method, the fields of the request type have\n  been converted into function parameters. Use the class `PhotosLibraryClient` to make these\n  requests.\n* A \"request object\" method. This type of method only takes one parameter, a request object, which\n  must be constructed before the call. Not every API method will have a request object method.\n* A \"callable\" method. This type of method takes no parameters and returns an immutable API callable\n  object, which can be used to initiate calls to the service.\n\n### Paged responses and Callables\n\nUsing the [Google API Extensions library](#google-api-extensions), pagination as described in the\n[Google Photos Library API developer documentation](https://developers.google.com/photos/library/guides/list#pagination)\nis supported via `PagedListResponse`, for example `ListAlbumsPagedResponse`.\n\n```java\ntry {\n    // Make a request to list all albums in the user's library\n    // Iterate over all the albums in this list\n    // Pagination is handled automatically\n    ListAlbumsPagedResponse response = photosLibraryClient.listAlbums();\n\n    for (Album album : response.iterateAll()) {\n        // Get some properties of an album and do something with them.\n        String id = album.getId();\n    }\n} catch (ApiException e) {\n    // Handle error\n}\n```\n\n## Retry configuration\n\nThe default retry configuration follows the [AIP guidance](https://google.aip.dev/194) for\nretrying API requests, which is configured in\n[`com.google.photos.library.v1.internal.stub.PhotosLibraryStubSettings`](photoslibraryapi/src/main/java/com/google/photos/library/v1/internal/stub/PhotosLibraryStubSettings.java)\nand [`com.google.photos.library.v1.PhotosLibrarySettings`](photoslibraryapi/src/main/java/com/google/photos/library/v1/PhotosLibrarySettings.java).\n\nHere's an example that shows how to customize the retry configuration for the `getAlbum(..)` call \nand for uploading media bytes:\n\n```java\n// Create a new retry configuration.\nRetrySettings retrySettings=RetrySettings.newBuilder()\n        .setInitialRetryDelay(Duration.ofSeconds(4))\n        .setRetryDelayMultiplier(1.5)\n        .setMaxAttempts(7)\n        .setMaxRetryDelay(Duration.ofSeconds(60))\n        .setTotalTimeout(Duration.ofMinutes(15))\n        .build();\n\n// Set the status codes returned from the API that should be retried.\n Set\u003cStatusCode.Code\u003eretryableCodes=\n        Set.of(StatusCode.Code.DEADLINE_EXCEEDED,StatusCode.Code.UNAVAILABLE);\n\n PhotosLibrarySettings.Builder librarySettingsBuilder=\n        PhotosLibrarySettings.newBuilder();\n\n// Configure these retry settings for the \"getAlbums\" call.\nlibrarySettingsBuilder.getAlbumSettings()\n        .setRetrySettings(retrySettings)\n        .setRetryableCodes(retryableCodes);\n\n// Configure these retry settings for the upload media call.\nlibrarySettingsBuilder.updateMediaItemSettings()\n        .setRetrySettings(retrySettings)\n        .setRetryableCodes(retryableCodes);\n\n// Configure other client options, for example authentication credentials.\n\n// Create the client.\nPhotosLibraryClient client = PhotosLibraryClient.initialize(librarySettingsBuilder.build());\n\n```\n\n## Samples\n\n A few examples are included in the [sample](sample/) directory. They show how\n to access media items, filter media, share albums and upload files.\n\nThe [API developer documentation](https://developers.google.com/photos) also includes\ncode snippets for this client library in Java.\n\n## Reference documentation\n\nJavadoc for this library can be found in the [gh-pages](https://github.com/google/java-photoslibrary/tree/gh-pages) branch of this repository.\nYou can browse it at https://google.github.io/java-photoslibrary/index.html\n\nGeneral Google Photos Library API documentation can be found on our Google Developers\nsite: https://developers.google.com/photos\n\n## Getting support\n\nFor client library specific bug reports, feature requests, and patches,\ncreate an issue on the [issue\ntracker](https://github.com/google/java-photoslibrary/issues).\n\nSee the [support page](https://developers.google.com/photos/library/support/how-to-get-help)\nfor any other API questions, bug reports, or feature requests.\n\n## Announcements and updates\n\nFor general Google Photos Library API and client library updates and news, follow:\n\n* [Java client library release notes](https://github.com/google/java-photoslibrary/releases)\n* [Google Photos Library API release notes](https://developers.google.com/photos/library/support/release-notes)\n\n## License\n\nCopyright 2018 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fjava-photoslibrary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Fjava-photoslibrary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fjava-photoslibrary/lists"}