{"id":13697831,"url":"https://github.com/orsifrancesco/instagram-without-api","last_synced_at":"2025-04-19T18:36:31.117Z","repository":{"id":53958482,"uuid":"265545485","full_name":"orsifrancesco/instagram-without-api","owner":"orsifrancesco","description":"A simple PHP code to get unlimited instagram public pictures by every user without api, without credentials.","archived":false,"fork":false,"pushed_at":"2024-02-18T22:34:50.000Z","size":1800,"stargazers_count":49,"open_issues_count":0,"forks_count":14,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-13T04:24:18.161Z","etag":null,"topics":["instagram","instagram-api","instagram-scraper","php","scraper","scraping","without-api"],"latest_commit_sha":null,"homepage":"https://orsi.me/instagram-without-api/","language":"PHP","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/orsifrancesco.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":"2020-05-20T11:35:29.000Z","updated_at":"2025-02-20T01:08:54.000Z","dependencies_parsed_at":"2024-02-18T23:30:31.338Z","dependency_job_id":"9f27f00b-1d84-4734-95b7-59ca55531e07","html_url":"https://github.com/orsifrancesco/instagram-without-api","commit_stats":{"total_commits":33,"total_committers":1,"mean_commits":33.0,"dds":0.0,"last_synced_commit":"6aa745719e983685873167dcf3d2fea1ed88cf5b"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orsifrancesco%2Finstagram-without-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orsifrancesco%2Finstagram-without-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orsifrancesco%2Finstagram-without-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orsifrancesco%2Finstagram-without-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orsifrancesco","download_url":"https://codeload.github.com/orsifrancesco/instagram-without-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249765913,"owners_count":21322498,"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":["instagram","instagram-api","instagram-scraper","php","scraper","scraping","without-api"],"created_at":"2024-08-02T18:01:03.549Z","updated_at":"2025-04-19T18:36:31.076Z","avatar_url":"https://github.com/orsifrancesco.png","language":"PHP","funding_links":["https://www.paypal.com/donate/?business=5EL4L2LDYVH96","https://paypal.me/orsifrancesco)--"],"categories":["PHP"],"sub_categories":[],"readme":"# ⛔️ DEPRECATED\n\nInstagram moved the pictures array to another endpoint (with more than one redirect) making harder to catch images server side without scrapers like [Puppeter](https://pptr.dev/).\n\nAlthought is not perfect \u003ca href=\"https://orsi.me/sniffagram\" rel=\"sniffagram\"\u003e\u003cimg style=\"vertical-align: middle\" alt=\"sniffagram\" width=\"100\" src=\"https://user-images.githubusercontent.com/6490641/232155875-ce2ea2ec-eeb5-4bcc-9af7-8c8d82887420.svg\" /\u003e\u003c/a\u003e (as a temporary solution) works.\n\nMaybe in the future I will share a new version, but judging by the many demands without any kind of gratitude and collaboration from the community, I have lost the desire.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/6490641/182688224-3730f63d-0428-49d6-a909-5a31fc3a38b9.png\" width=\"128\" height=\"128\" alt=\"instagram-without-api\" /\u003e\n\u003c/p\u003e\n\u003ch2 align=\"center\"\u003eInstagram Without APIs\u003c/h2\u003e\n\u003ch3 align=\"center\"\u003eInstagram Scraping \u003cstrong\u003e(@users and #tags)\u003c/strong\u003e in April 2023, no credentials required\u003c/h3\u003e\n\n\u003cbr/\u003e\n\nThis is a PHP library, are you looking for the same in Node.js? go to https://orsi.me/instagram-without-api/.\n\nA simple PHP code to get **unlimited instagram public pictures** by **every user** without api, **without credentials** (just token from cookies), just Instagram Scraping in 2023 (with cookie and image data in base64).\n\nYou can get the latest pictures/information from an account or a single picture/information by id.\n\n### [📦 Packagist link](https://packagist.org/packages/orsifrancesco/instagram-without-api)\n### [🛕 Cool Project Example](https://orsi.me/sniffagram) \u003ca href=\"https://orsi.me/sniffagram\" rel=\"sniffagram\"\u003e\u003cimg style=\"vertical-align: middle\" alt=\"sniffagram\" width=\"100\" src=\"https://user-images.githubusercontent.com/6490641/232155875-ce2ea2ec-eeb5-4bcc-9af7-8c8d82887420.svg\" /\u003e\u003c/a\u003e\n### [🎮 Demo / Example](https://orsifrancesco.github.io/instagram-without-api/how-to-show-base64-images.html)\n### ⚖️ Licensed under MIT\n### 🤓 Author [@orsifrancesco](https://twitter.com/orsifrancesco)\n### ☕ [Coffees are welcome](https://www.paypal.com/donate/?business=5EL4L2LDYVH96) \u003csmall\u003e(in particular if you appreciate the project or you plan to contact me)\u003c/small\u003e\n\u003c!--### ☕ [Offer me a coffee](https://paypal.me/orsifrancesco)--\u003e\n\n\u003chr/\u003e\n\n## 📦 Installation from [Composer Repository](https://packagist.org/packages/orsifrancesco/instagram-without-api)\n\n```bash\ncomposer require orsifrancesco/instagram-without-api\n```\n\n## 📦 Installation from this Repository\n\n```bash\ncomposer install\n\n# download the file https://github.com/orsifrancesco/instagram-without-api/blob/master/test.php\n# add your cookie, user-agent and x-ig-app-id following the next step \"How to get Instagram Cookie\"\n\nphp test.php\n```\n\n## 🍪 How to get Instagram Cookie\n\n- Login to Instagram\n- Go to your https://instagram/yourUsername\n- Open your Browser Console (on Chrome just pressing F12)\n  1. Select the \"Network\" tab\n  2. Search and click on \"timeline/\" file; if it is empty just refresh the page\n  3. Select \"Headers\" bar\n  4. Be sure the file is Request Method \"POST\" (if it is \"OPTIONS\" search the other \"timeline/\" file in the list)\n  5. Scroll down and select \"Request Headers\" tab\n  6. Copy all the code after the word \"cookie: \" and paste it on `$cookie` variable\n  7. Copy all the code after the word \"user-agent: \" and paste it on `$userAgent` variable\n  8. Copy all the code after the word \"x-ig-app-id: \" and paste it on `$xIgAppId` variable\n```diff\n- don't share your cookie code with anyone!!! it is the same of your credentials\n```\n- That's it, enjoy :)\n\n![follow this steps](https://user-images.githubusercontent.com/6490641/181632823-42fb2308-4c3f-421a-848a-58cefcf98915.png \"follow this steps\")\n\n## 💻 Images Base64\nAlthough you can get the URLs of the images, Instagram doesn't give you the possibility to include and showing those images on your projects (they will be automatically blocked from their servers).\\\nTo solve this problem you will get all the URLs and all the images data in base64.\\\nYou can easily show the image data on your project with the following snippets of code:\n\n```html\n\u003cimg src=\"data:image/jpg;base64, hereYourBase64String..\"/\u003e\n```\n```css\n.example { background-image: url('data:image/jpg;base64, hereYourBase64String..'); }\n```\n\nCheck https://orsifrancesco.github.io/instagram-without-api/how-to-show-base64-images.html for Base64 example.\n\n## 🛕 Cool Project Example\n\u003ca href=\"https://orsi.me/sniffagram\" rel=\"sniffagram\"\u003e![sniffagram](https://user-images.githubusercontent.com/6490641/232155875-ce2ea2ec-eeb5-4bcc-9af7-8c8d82887420.svg \"sniffagram\")\u003c/a\u003e\n\n## 🎮 Demo / Example\nexample on https://github.com/orsifrancesco/instagram-without-api/blob/master/test.php\n\n```php\n\u003c?php\n\nrequire_once __DIR__ . '/vendor/autoload.php';  // Autoload files using Composer autoload\n\nuse InstagramWithoutApi\\Fetch;\n\n$cookie = 'mid=YYcwjgAL....8765\"';              // \u003c!-- required!! please get your cookie from your browser console (6)\n$userAgent = 'Mozilla/5.0...Chrome/537.36';     // \u003c!-- required!! please get your user-agent from your browser console (7)\n$xIgAppId = '9366197...';                       // \u003c!-- required!! please get your x-ig-app-id from your browser console (8)\n\n\n\n// get the latest 12 feeds from a tag (example https://instagram.com/explore/tags/love)\n\necho Fetch::fetchByTag([\n\n  \"group\" =\u003e 'recent',                      // \u003c!-- \"recent\" images or \"top\" images; \"recent\" is by default \n  \"base64images\" =\u003e true,                   // \u003c!-- optional, but without you will be not able to save images.. it increases the size of the json file\n  \"base64imagesCarousel\" =\u003e false,          // \u003c!-- optional but not recommended, it increases the size of the json file\n  \"base64videos\" =\u003e false,                  // \u003c!-- optional but not recommended, it increases the size of the json file\n\n  \"header\" =\u003e                                   \n    'cookie: ' . $cookie . \"\\r\\n\" .\n    'user-agent: ' . $userAgent . \"\\r\\n\" .\n    'x-ig-app-id: ' . $xIgAppId . \"\\r\\n\" .\n    '',\n\n  \"maxImages\" =\u003e 4,                         // \u003c!-- optional, 12 is the max number\n  \"file\" =\u003e \"instagram-cache-bytag.json\",   // \u003c!-- optional, instagram-cache.json is by default\n  \"time\" =\u003e 3600,                           // \u003c!-- optional, reload contents after 3600 seconds by default\n  \"pretty\" =\u003e true,                         // \u003c!-- optional, prettyfy json true/false\n\n  \"id\" =\u003e \"love\",                           // \u003c!-- id is required\n\n]);\n\n\n\n// get the latest 12 pictures from an account (example https://www.instagram.com/orsifrancesco/)\n\necho Fetch::fetch([\n\n  \"base64images\" =\u003e true,                   // \u003c!-- optional, but without you will be not able to save images.. it increases the size of the json file\n  \"base64imagesCarousel\" =\u003e false,          // \u003c!-- optional but not recommended, it increases the size of the json file\n  \"base64videos\" =\u003e false,                  // \u003c!-- optional but not recommended, it increases the size of the json file\n\n  \"header\" =\u003e                                   \n    'cookie: ' . $cookie . \"\\r\\n\" .\n    'user-agent: ' . $userAgent . \"\\r\\n\" .\n    'x-ig-app-id: ' . $xIgAppId . \"\\r\\n\" .\n    '',\n\n  \"maxImages\" =\u003e 4,                           // \u003c!-- optional, 12 is the max number\n  \"file\" =\u003e \"instagram-cache.json\",           // \u003c!-- optional, instagram-cache.json is by default\n  \"time\" =\u003e 3600,                             // \u003c!-- optional, reload contents after 3600 seconds by default\n  \"pretty\" =\u003e true,                           // \u003c!-- optional, prettyfy json true/false\n\n  \"id\" =\u003e \"orsifrancesco\",                    // \u003c!-- id is required\n\n]);\n\n\n\n// get picture and info from instagram id url (example https://www.instagram.com/p/Cgczi6qMuh1/)\n\necho Fetch::fetchByIdUrl([\n\n  \"header\" =\u003e                                   \n    'cookie: ' . $cookie . \"\\r\\n\" .\n    'user-agent: ' . $userAgent . \"\\r\\n\" .\n    'x-ig-app-id: ' . $xIgAppId . \"\\r\\n\" .\n    '',\n\n  \"file\" =\u003e \"instagram-cache-byidurl.json\",   // \u003c!-- optional, instagram-cache-byidurl-{id}.json is by default\n  \"time\" =\u003e 3600,                             // \u003c!-- optional, reload contents after 3600 seconds by default\n  \"pretty\" =\u003e true,                           // \u003c!-- optional, prettyfy json true/false\n\n  \"id\" =\u003e \"Cgczi6qMuh1\",                      // \u003c!-- id is required\n\n]);\n\n\n\n// get picture and info from instagram id (2898553675947377985 is the id of https://www.instagram.com/p/Cgczi6qMuh1/)\n\necho Fetch::fetchById([\n\n  \"base64images\" =\u003e true,                   // \u003c!-- optional, but without you will be not able to save images.. it increases the size of the json file\n  \"base64videos\" =\u003e false,                  // \u003c!-- optional but not recommended, it increases the size of the json file\n\n  \"header\" =\u003e                                   \n    'cookie: ' . $cookie . \"\\r\\n\" .\n    'user-agent: ' . $userAgent . \"\\r\\n\" .\n    'x-ig-app-id: ' . $xIgAppId . \"\\r\\n\" .\n    '',\n\n  \"file\" =\u003e \"instagram-cache-byid.json\",    // \u003c!-- optional, instagram-cache-byid-{id}.json is by default\n  \"time\" =\u003e 3600,                           // \u003c!-- optional, reload contents after 3600 seconds by default\n  \"pretty\" =\u003e true,                         // \u003c!-- optional, prettyfy json true/false\n\n  \"id\" =\u003e \"2890411760684296309\",            // \u003c!-- id is required\n\n]);\n\n?\u003e\n```\n\n## 🕹️ JSON outputs\noutput example for `Fetch::fetchByTag` or `Fetch::fetch` on https://github.com/orsifrancesco/instagram-without-api/blob/master/instagram-cache.json\n```json\n[\n  {\n    \"id\": \"2696840872190940431\",\n    \"time\": 1635708506,\n    \"imageUrl\": \"https://scontent-lcy1-1.cdninstagram.com/v/t51.2885-15/e35/p1080x1080/249938862_1214260935751176_32...\",\n    \"likes\": 18,\n    \"comments\": 0,\n    \"link\": \"https://www.instagram.com/p/CVtGnwashUP/\",\n    \"text\": \"#helloworld #domain #check\",\n    \"image\": \"/9j/4AAQSkZJRgABAQAAAQABAAD/7QB8UGhvdG9zaG9wIDMuMAA4QklNBAQAAAAAAGA.............\",\n    \"location\": \"Liverpool Cathedral\",\n    \"carousel\": [\n      {\n        \"imageUrl\": \"https://scontent.cdninstagram.com/v/t51.2885-15/314902884_370847155226583_8126....\",\n        \"image\": \"/9j/4AAQSsasaakZJRgABAQAAAQABAAD/7QB8UGhvdGQAAAAAAGA.............\"\n      },\n      {\n        \"imageUrl\": \"https://scontent.cdninstagram.com/v/t51.2885-15/314674373_678631710324...\",\n        \"image\": \"/9j/4AAQSkZJRgABAQAAAQdG9zaG9wIDMuMAA4QklNBAQAAAAAAGA.............\"\n      }\n    ]\n  },\n  {\n    \"id\": \"2654027113529608497\",\n    \"time\": 1630604708,\n    \"imageUrl\": \"https://scontent-lcy1-1.cdninstagram.com/v/t51.2885-15/e35/p1080x1080/241221239_8640769...\",\n    \"videoUrl\": \"https://scontent-lcy1-1.cdninstagram.com/v/t51.2885-15/e35/p1080x1080/241221239_8640769...\",\n    \"likes\": 38,\n    \"comments\": 0,\n    \"link\": \"https://www.instagram.com/p/CTU_5keMAkx/\",\n    \"text\": \"#london #uk #unitedkingdom #tube #underground #overground #sunrise #morning #morningvibes #sky #metro #line #prospective\",\n    \"image\": \"/9j/4AAQSkZJRgABAQAAAQABAAD/7QB8UGhvdG9zaG9wIDMuMAA4Qkl...........\",\n    \"location\": \"Eiffle Tower, Paris France.\"\n  }\n]\n```\n\noutput example for `Fetch::fetchByIdUrl` or `Fetch::fetchById`\n```json\n[\n  {\n    \"id\": \"289855367...\",\n    \"width\": 1385,\n    \"height\": 1731,\n    \"imageUrl\": \"https:\\/\\/scontent-lhr8-1.cdnin...\",\n    \"time\": 1659754546,\n    \"topLikers\": [\n        \"franko\"\n    ],\n    \"likes\": 32,\n    \"commentCount\": 2,\n    \"comments\": [\n      {\n        \"time\": 1659756069,\n        \"text\": \"This is a comment...\",\n        \"user\": {\n          \"username\": \"test\",\n          \"fullName\": \"DearTest\",\n          \"imageUrl\": \"https:\\/\\/scontent-lhr8-1.cdninstagram.com...\"\n        }\n      }\n    ],\n    \"link\": \"https:\\/\\/www.instagram.com\\/p\\/Cgczi6qMuh1\\/\",\n    \"text\": \"If you know it, you know it...\",\n    \"user\": {\n      \"username\": \"orsifrancesco\",\n      \"fullName\": \"Frank\",\n      \"imageUrl\": \"https:\\/\\/scontent-lhr8-1.cd...\"\n    },\n    \"image\": \"\\/9j\\/4AAQSkZJR....Q==\"\n  }\n]\n```\n\n## ⚖️ License\n\nLicensed under MIT\n\n\n## ☕ About\n\nAny feedback to [@orsifrancesco](https://twitter.com/orsifrancesco) and [coffees](https://www.paypal.com/donate/?business=5EL4L2LDYVH96) are welcome :) ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forsifrancesco%2Finstagram-without-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forsifrancesco%2Finstagram-without-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forsifrancesco%2Finstagram-without-api/lists"}