{"id":18599319,"url":"https://github.com/bkawk/ipfs-api","last_synced_at":"2025-05-16T15:14:04.390Z","repository":{"id":106274208,"uuid":"154357351","full_name":"bkawk/IPFS-API","owner":"bkawk","description":"Simple Image upload API for IPFS","archived":false,"fork":false,"pushed_at":"2018-10-23T16:03:45.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-18T00:42:10.948Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/bkawk.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":"2018-10-23T15:59:53.000Z","updated_at":"2018-10-24T22:56:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"043a1154-e74f-413b-8851-ca4e446ae095","html_url":"https://github.com/bkawk/IPFS-API","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkawk%2FIPFS-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkawk%2FIPFS-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkawk%2FIPFS-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkawk%2FIPFS-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bkawk","download_url":"https://codeload.github.com/bkawk/IPFS-API/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254554021,"owners_count":22090419,"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":[],"created_at":"2024-11-07T01:38:40.137Z","updated_at":"2025-05-16T15:14:04.243Z","avatar_url":"https://github.com/bkawk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Image to IPFS\n\nA minimal API for saving and retrieving image data to/from IPFS\n\n\n## Node \u0026 IPFS\n\nFirst, make sure you have NPM (packaged with [Node.js](https://nodejs.org)) installed. Run `npm install` to install your element's dependencies, then run `polymer serve` to serve your element locally. Also, ensure you IPFS installed and the daemon running [IPFS](https://ipfs.io/docs/install/)\n\n## Start the server \n\n```\n$ npm run now\n```\n\n## Saving data to IPFS\n\nCurrently, there are no size or domain restrictions, text-based data can be stored on IPFS by making a POST request to \n\n```\n/ipfs \n```\n\nthe body should contain an object with the key of 'data' and the value containing URI Encoded base 64 value you want to save, in this example we are storing a 1px transparent gif as a base 64 string.\n\n```\n{\"data\":\"data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\"}\n```\n\nthe response is an object with success and hash keys\n\n```\n{\n    \"success\": true,\n    \"hash\": \"QmczMXpyKH2msqMEYC9dD9YcvPAAkeB4GUBNxcue52rCVH\"\n}\n```\n\n## Getting data from IPFS\n\nTo get data from IPFS you can make a GET request containing the IPFS Hash you wish to get\n\n```\n/ipfs/QmczMXpyKH2msqMEYC9dD9YcvPAAkeB4GUBNxcue52rCVH\n```\n\nThe response is an object with success and data keys\n\n```\n{\n    \"success\": true,\n    \"data\": \"data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\"\n}\n```\n\n## Getting Image SRC Data \n\nGetting image src data is possible to allow direct loading of images\n\n```\n/img/QmczMXpyKH2msqMEYC9dD9YcvPAAkeB4GUBNxcue52rCVH\n```\n\nThe response is just the data, no object is returned.\n\n```\ndata:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkawk%2Fipfs-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbkawk%2Fipfs-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkawk%2Fipfs-api/lists"}