{"id":15663899,"url":"https://github.com/kysely/messenger-personal-api","last_synced_at":"2025-05-06T18:48:34.132Z","repository":{"id":57295280,"uuid":"93698656","full_name":"kysely/messenger-personal-api","owner":"kysely","description":"Hacky API for receiving messages on Facebook personal accounts. Runs on Electron","archived":false,"fork":false,"pushed_at":"2017-06-09T02:08:58.000Z","size":9,"stargazers_count":18,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-16T05:17:25.285Z","etag":null,"topics":["api","electron","facebook-api","javascript","messenger","messenger-bot","nodejs"],"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/kysely.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}},"created_at":"2017-06-08T02:20:32.000Z","updated_at":"2024-10-14T08:31:22.000Z","dependencies_parsed_at":"2022-08-31T03:01:43.859Z","dependency_job_id":null,"html_url":"https://github.com/kysely/messenger-personal-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/kysely%2Fmessenger-personal-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kysely%2Fmessenger-personal-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kysely%2Fmessenger-personal-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kysely%2Fmessenger-personal-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kysely","download_url":"https://codeload.github.com/kysely/messenger-personal-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252749477,"owners_count":21798522,"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","electron","facebook-api","javascript","messenger","messenger-bot","nodejs"],"created_at":"2024-10-03T13:40:26.212Z","updated_at":"2025-05-06T18:48:34.112Z","avatar_url":"https://github.com/kysely.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp\u003e\n  \u003ch1 align=\"center\"\u003eMessenger Personal API\u003c/h1\u003e\n  \u003ch4 align=\"center\"\u003eHacky solution for receiving messages on personal accounts\u003c/h4\u003e\n  \u003cp align=\"center\"\u003e\u003ca href=\"https://badge.fury.io/js/messenger-personal-api\"\u003e\u003cimg src=\"https://badge.fury.io/js/messenger-personal-api.svg\" alt=\"npm version\" height=\"18\"\u003e\u003c/a\u003e\u003c/p\u003e\n  \u003chr /\u003e\n\u003c/p\u003e\n\nWhy hacky? `messenger-personal-api` **is an Electron app** that extracts messages from Messenger.com's DOM... so not optimal, but working solution.\n\n## Install\n```sh\nnpm install messenger-personal-api --save\n```\n*You will need to have `electron` package installed as well.*\n\n## Getting Started\n```javascript\nimport { MessengerAPI } from 'messenger-personal-api'\n\nconst api = new MessengerAPI({\n    email: 'your@email.com',\n    pass: 'SuperSecretPassword'\n})\n\napi.start()\n\napi.on('new_message', message =\u003e {\n    console.log(`${message.sender}: ${message.content}`)\n})\n```\n\n## Run\n```sh\nelectron .\n```\n*You will need to run your program as an Electron app.*\n\n**TIP:** If you need the API for non-electron app, you can build a very simple http(s) server on Electron and let it send POST requests to your app.\n\n## API in Detail\n### New instance of API\nIf you initialize the API with both e-mail and password, user will be logged in automatically.\n\nIf you only fill in the e-mail, you'll be prompted to type in your password securely via HTTPS connection to Messenger.com.\n\nPassword encryption will hopefully be implemented in future versions of the API.\n```javascript\nconst api = new MessengerAPI({\n    email: 'your@email.com',\n    // Hard-code your password only if\n    // you don't distribute this piece of app\n    // where it could get decompiled\n    pass: 'SuperSecretPassword'\n})\n```\n\n### Start the API\n```javascript\n// Simply start the API\napi.start()\n\n// Or start and listen to useful messages\n// (e.g. logged in, couldn't log in etc)\napi.start((err, message) =\u003e {\n    if (err) {\n        console.error(err.content)\n    } else {\n        console.log(message)\n    }\n})\n```\n\n### Listen to new messages\n```javascript\napi.on('new_message', message =\u003e {\n    // new message object\n})\n```\n\n### Messages Format\nAll messages are sent to you as objects, e.g.:\n```javascript\n{\n    type: 'text',\n    date: 1496966580162, // Date in UTC format\n    sender: 'Your Friend',\n    sender_id: '1032752459',\n    content: 'Chill out my friend 😎'\n}\n```\n\n### Message `type:`\n#### `text`\nReturns plain text with emojis in `content`\n#### `image`\nReturns URL of the image/s in `content`\n#### `video`\nReturns URL of the video in `content`\n#### `attachment`\nReturns URL of the attached file in `content`\n#### `thumbs_up`\nReturns 👍 in `content`\n#### `sticker`\nReturns URL of the sticker in `content`\n#### `huge_emoji`\nReturns URL of the inflated emoji in `content`\n#### `gif`\nReturns the GIF URL in `content`\n#### `link`\nReturns the link from featured tab in `content`\n#### `voice`\nCurrently can't retrieve the actual message.\n\n## Contribute\nThese are some points that need few hours of work:\n- ability to send messages\n- leave DOM as much as possible (during final debugging, I found out messages are also passed to front-end in server response inside `thread_info.php`)\n- genuinely secure way to store password in configuration\n\nSo if you're awesome and want to contribute to this project, go fork, clone and send pull requests!\n\n### Shout-out!\nThanks to [Caprine](https://github.com/sindresorhus/caprine) for DOM-wrapped-in-Electron app inspiration.\n\n## Disclaimer\nThis is a third-party application and is not affiliated with Facebook.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkysely%2Fmessenger-personal-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkysely%2Fmessenger-personal-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkysely%2Fmessenger-personal-api/lists"}