{"id":44418128,"url":"https://github.com/Instagram4j/Instagram4j","last_synced_at":"2026-02-24T15:00:52.424Z","repository":{"id":38380728,"uuid":"80889548","full_name":"instagram4j/instagram4j","owner":"instagram4j","description":":camera: Instagram private API in Java","archived":false,"fork":false,"pushed_at":"2023-08-20T02:37:33.000Z","size":1261,"stargazers_count":936,"open_issues_count":113,"forks_count":263,"subscribers_count":67,"default_branch":"master","last_synced_at":"2026-01-14T17:17:14.439Z","etag":null,"topics":["instagram","instagram-api","instagram-client","instagram-java-scraper","java","scraper"],"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/instagram4j.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["jvogit"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2017-02-04T03:12:35.000Z","updated_at":"2025-12-29T22:12:27.000Z","dependencies_parsed_at":"2023-02-12T07:16:41.980Z","dependency_job_id":null,"html_url":"https://github.com/instagram4j/instagram4j","commit_stats":null,"previous_names":["brunocvcunha/instagram4j"],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/instagram4j/instagram4j","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instagram4j%2Finstagram4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instagram4j%2Finstagram4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instagram4j%2Finstagram4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instagram4j%2Finstagram4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/instagram4j","download_url":"https://codeload.github.com/instagram4j/instagram4j/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/instagram4j%2Finstagram4j/sbom","scorecard":{"id":489962,"data":{"date":"2025-08-11","repo":{"name":"github.com/instagram4j/instagram4j","commit":"39635974c391e21a322ab3294275df99d7f75f84"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.1,"checks":[{"name":"Code-Review","score":4,"reason":"Found 6/13 approved changesets -- score normalized to 4","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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/gradle.yml:1","Info: no jobLevel write permissions found"],"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":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"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":"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":"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":"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":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/gradle.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/instagram4j/instagram4j/gradle.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/gradle.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/instagram4j/instagram4j/gradle.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"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":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 23 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-19T18:50:02.877Z","repository_id":38380728,"created_at":"2025-08-19T18:50:02.878Z","updated_at":"2025-08-19T18:50:02.878Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29786978,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T10:45:18.109Z","status":"ssl_error","status_checked_at":"2026-02-24T10:45:09.911Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["instagram","instagram-api","instagram-client","instagram-java-scraper","java","scraper"],"created_at":"2026-02-12T09:00:39.938Z","updated_at":"2026-02-24T15:00:52.417Z","avatar_url":"https://github.com/instagram4j.png","language":"Java","funding_links":["https://github.com/sponsors/jvogit"],"categories":["APIs \u0026 SDKs"],"sub_categories":[],"readme":"\n\n\n\ninstagram4j\n========\n![Java CI with Gradle](https://github.com/instagram4j/instagram4j/workflows/Java%20CI%20with%20Gradle/badge.svg?branch=develop)\n[![Apache License](http://img.shields.io/badge/license-ASL-blue.svg)](https://github.com/brunocvcunha/instagram4j/blob/master/LICENSE)\n[![Discord](https://img.shields.io/discord/777326687326044171?label=chat)](https://discord.com/invite/gR2EPwZGEZ)\n\n:camera: Java wrapper using OkHttpClient for Instagram's private api (Android emulation)\n## Table of contents\n - [Install](#install)\n - [Overview](#overview)\n     - [Features](#features)\n - [Usage](#usage)\n     - [Terms and Conditions](#terms-and-conditions)\n     - [Quick Usage](#quick-usage)\n     - [Setup \u0026 Login](#setup-and-login)\n         - [Simple Login](#simple-login)\n         - [Two factor login](#two-factor-login)\n         - [Challenge login](#challenge-login)\n         - [Login with proxy](#login-with-proxy)\n     - [Sending requests and actions](#sending-requests-and-actions)\n     - [Serialization](#serialization)\n - [Contributing](#contributing)\n\n# Install\n\n#### Example for gradle:\n```java\ndependencies {\n    implementation 'com.github.instagram4j:instagram4j:2.0.7'\n}\n```\n\n#### Example for maven:\n```\n  \u003cdependencies\u003e\n    \u003cdependency\u003e \n      \u003cgroupId\u003ecom.github.instagram4j\u003c/groupId\u003e\n      \u003cartifactId\u003einstagram4j\u003c/artifactId\u003e\n      \u003cversion\u003e2.0.7\u003c/version\u003e\n    \u003c/dependency\u003e \n  \u003c/dependencies\u003e\n```\n\nFor develop (unreleased to central) builds, jitpack can be used.\n\n```java\nrepositories {\n    maven {\n        url 'https://jitpack.io'\n    }\n}\n```\n```java\ndependencies {\n    implementation 'com.github.instagram4j:instagram4j:master-SNAPSHOT'\n}\n```\n\n#### Example for maven:\n```xml\n  ...\n  \u003cdependencies\u003e\n      ...\n    \u003cdependency\u003e \n      \u003cgroupId\u003ecom.github.instagram4j\u003c/groupId\u003e\n      \u003cartifactId\u003einstagram4j\u003c/artifactId\u003e\n      \u003cversion\u003emaster-SNAPSHOT\u003c/version\u003e\n    \u003c/dependency\u003e \n  \u003c/dependencies\u003e\n  ...\n  \u003crepositories\u003e\n    ...\n    \u003crepository\u003e\n      \u003cid\u003ejitpack\u003c/id\u003e\n      \u003curl\u003ehttps://jitpack.io\u003c/url\u003e   \n    \u003c/repository\u003e\n \u003c/repositories\u003e\n```\n\n## Requirements\nThis project depends on\n- Java 8+\n- okhttpclient\n- okhttpclient url connection\n- jackson data-bind\n- jackson annotations\n- slf4j-api\n- apache commons codec\n# Overview\nThis Java library provides requests that emulate the Android Instagram app. Most of the official app functionality is supported here. This library has undergone a massive rewrite (instagram4j 1.x.x is not compatible) The rewrite intends to help with maintainability and flexibility throughout time.\n## Features\nMost of the Android Instagram app features are supported. Here are some notable ones.\n- OkHttpClient and jackson-databind\n- two factor login\n- support for challenges\n- iterable feeds\n- serialization\n- timeline, story, live, direct messaging, shopping, and more!\n\n# Usage\n## Terms and Conditions\nThis library is intended for personal use and for educational experiences due to limitations of Instagram's public API.\n\n - Please use Instagram's public API if possible\n - Do not use this library to spam (botting, spam messaging, etc...)\n - There will be no support for those with malicious intent\n - Use reasonable (human) delay in between sending requests\n - Don't be evil.\n\nThis library is in no way affiliated with, authorized, maintained, sponsored or endorsed by Instagram or any of its affiliates or subsidiaries. This is an independent and unofficial API. Use at your own risk.\n\nContributors are not responsible for usage and maintainability. Due to the nature of this project, some features of the library are not guaranteed as they make change and break in the future. This library is licensed under ASL.\n\n---\n## Quick Usage\n**Login:**\n```java\nIGClient client = IGClient.builder()\n        .username(\"username\")\n        .password(\"password\")\n        .login();\n```\n**Actions:**\n```java\nIGClient client = ...\n\nclient.actions()\n.timeline()\n.uploadPhoto(new File(\"myPhoto.jpg\"), \"My Caption\")\n.thenAccept(response -\u003e {\n    System.out.println(\"Successfully uploaded photo!\");\n})\n.join(); // block current thread until complete\n```\n**Executing requests:**\n```java\nIGClient client = ...\n\n// Alternatively use client.sendRequest\nnew FeedTimelineRequest().execute(client)\n.thenAccept(response -\u003e {\n    response.getFeed_items().forEach(...);\n})\n.join(); // block current thread until complete\n```\n## Setup and Login\nAn IGClient instance must be constructed and logged in to send most requests. \n### Simple Login\nBasic login using IGClient builder method.\n#### *Example:*\n```java\nIGClient client = IGClient.builder()\n        .username(\"username\")\n        .password(\"password\")\n        .login();\n```\n#### *Example:*\n```java\n// simulate pre login flow (synchronous) and post login flow (asynchronous)\nIGClient client = IGClient.builder()\n        .username(\"username\")\n        .password(\"password\")\n        .simulatedLogin();\n```\n### Two factor login\nProvide a consumer that may resolve two factor login process. The example uses the included utility to resolve two factor logins.\n#### *Example:*\n```java\nScanner scanner = new Scanner(System.in);\n\n// Callable that returns inputted code from System.in\nCallable\u003cString\u003e inputCode = () -\u003e {\n    System.out.print(\"Please input code: \");\n    return scanner.nextLine();\n};\n\n// handler for two factor login\nLoginHandler twoFactorHandler = (client, response) -\u003e {\n    // included utility to resolve two factor\n    // may specify retries. default is 3\n    return IGChallengeUtils.resolveTwoFactor(client, response, inputCode);\n};\n\nIGClient client = IGClient.builder()\n        .username(\"username\")\n        .password(\"password\")\n        .onTwoFactor(twoFactorHandler)\n        .login();\n```\n### Challenge login\nSometimes a challenge may arise when logging in. Provide a LoginHandler to handle challenges. The example uses the included utility to handle challenges automatically.\n#### *Example:*\n```java\nScanner scanner = new Scanner(System.in);\n\n// Callable that returns inputted code from System.in\nCallable\u003cString\u003e inputCode = () -\u003e {\n    System.out.print(\"Please input code: \");\n    return scanner.nextLine();\n};\n\n// handler for challenge login\nLoginHandler challengeHandler = (client, response) -\u003e {\n    // included utility to resolve challenges\n    // may specify retries. default is 3\n    return IGChallengeUtils.resolve(client, response, inputCode);\n};\n\nIGClient client = IGClient.builder()\n        .username(\"username\")\n        .password(\"password\")\n        .onChallenge(challengeHandler)\n        .login();\n```\n### Login with proxy\nYou may provide Proxy and Authenticator for the Proxy through configuring an OkHttpClient and passing it in through the builder.\n```java\nOkHttpClient httpClient = new OkHttpClient.Builder().proxy(...).build();\nIGClient client = IGClient.builder()\n        .username(\"username\")\n        .password(\"password\")\n        .client(httpClient)\n        .login();\n```\n## Sending requests and actions\nThis library provides a limited wrapper api that may be used to locate and send common requests. Not all features are supported through actions currently. Actual requests are located under the requests package and can be sent through IGClient like in previous versions. Requests can be sent asynchronously. All requests return a [CompletableFuture](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html).\n\n#### *Simple Example:*\n```java\nIGClient client = ...\n\nclient.actions().timelime()\n.uploadPhoto(new File(\"myPhoto.jpg\"), \"My Caption\")\n.thenAccept(res -\u003e {\n    // perform actions with response\n    log.info(\"Uploaded photo {}\", response.getMedia().getId());\n})\n.exceptionally(tr -\u003e {\n    // something has terribly gone wrong!\n    // handle exception\n    \n    return null;\n})\n.join(); // blocks currect thread until completion\n```\n#### *Chainng Example:*\n```java\nIGClient client = ...\n\n// finds user by username then gets friendship status\nclient.actions().users()\n.findByUsername(\"instagram\")\n.thenCompose(UserAction::getFriendship)\n.thenAccept(friendship -\u003e {\n    // response here\n})\n.join();\n\n// uploads a photo then comments on it\nclient.actions().timeline()\n.uploadPhoto(new File(\"myPhoto.jpg\"), \"My Caption\")\n.thenCompose(response -\u003e {\n    // action with response\n    return new MediaCommentRequest(response.getMedia().getId(), \"First comment!\").execute(client)\n})\n.join();\n\n```\n## Serialization\nIGClient and cookies can serialize into two files out of the box.\n```java\nIGClient client = ...\nFile clientFile = new File(...);\nFile cookieFile = new File(...);\n// serializing\nclient.serialize(clientFile, cookieFile);\n// deserializing\nIGClient deserializedClient = IGClient.deserialize(clientFile, cookieFile);\n```\nIGClient is [Serializable](https://docs.oracle.com/javase/tutorial/jndi/objects/serial.html). The SerializableCookieJar used to store cookie's in OkHttpClient is Serializable as well. This opens to other mediums of storing serialization too, not just files.\n\n# Contributing\nSee Issues tab to find good starting issues to work on. If you have an addition you would like to make, please do not hesitate to make a pull request!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FInstagram4j%2FInstagram4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FInstagram4j%2FInstagram4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FInstagram4j%2FInstagram4j/lists"}