{"id":13628581,"url":"https://github.com/GraysonCAdams/amex-ynab-import","last_synced_at":"2025-04-17T04:31:56.007Z","repository":{"id":206599942,"uuid":"717270052","full_name":"GraysonCAdams/amex-ynab-import","owner":"GraysonCAdams","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-22T20:48:31.000Z","size":85,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-08T19:41:59.794Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GraysonCAdams.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-11-11T00:50:28.000Z","updated_at":"2024-08-28T04:34:53.000Z","dependencies_parsed_at":"2024-03-01T22:26:35.297Z","dependency_job_id":"97fdfc90-2e19-41b2-9b62-6e22d1332b36","html_url":"https://github.com/GraysonCAdams/amex-ynab-import","commit_stats":null,"previous_names":["graysoncadams/amex-ynab-import"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GraysonCAdams%2Famex-ynab-import","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GraysonCAdams%2Famex-ynab-import/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GraysonCAdams%2Famex-ynab-import/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GraysonCAdams%2Famex-ynab-import/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GraysonCAdams","download_url":"https://codeload.github.com/GraysonCAdams/amex-ynab-import/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249315954,"owners_count":21249866,"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-08-01T22:00:54.200Z","updated_at":"2025-04-17T04:31:55.659Z","avatar_url":"https://github.com/GraysonCAdams.png","language":"TypeScript","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# AMEX YNAB Import\n\n⚠️ **If you use this, unlink your AMEX accounts on YNAB first, otherwise Plaid may add duplicates.**\n\nUnreliable connections over the course of the last few years means taking matters into our own hands. Other tools I found are still a bit of a manual process, downloading CSV's or QFX files and converting them to then upload them. This tool is meant to go the whole nine yards, and do every step for you with just one command.\n\n```\n$ npm run start\n\n\u003e start\n\u003e node --no-warnings=ExperimentalWarning --import=./logError.js --loader ts-node/esm index.ts\n\nFound YNAB accounts:\n - Venmo\n - Checking\n - Savings\n - Blue Business Plus\n - Gold\n - Charles Schwab Platinum\n - Amazon\n\nGoing to American Express to fetch your CSV files and match to YNAB accounts by name\nPulling up American Express...\nFilling login credentials...\nSubmitting...\nOpting out of mobile push notification...\nWaiting for OTP prompt... (will choose email)\nConnecting to mail server...\nSuccessfully connected to mail server!\nOpening mailbox...\nMailbox opened\nClicking the \"Email\" OTP button...\nWatching for new emails...\n1 new email(s), scanning contents...\nFound the OTP email\nDiscarded email now that it's cached\nFound accounts: Blue Business Plus, Charles Schwab Platinum, Gold\n[..] Fetching Blue Business Plus CSV\n[✓] Fetched Blue Business Plus CSV\n[..] Fetching Charles Schwab Platinum CSV\n[✓] Fetched Charles Schwab Platinum CSV\n[..] Fetching Gold CSV\n[✓] Fetched Gold CSV\nCharles Schwab Platinum may have some transactions imported\nGold may have some transactions imported\nImporting 22 transactions to YNAB (it will ignore duplicate imports, so actual amount may differ)\nAll done. Until next time! 👋\n```\n\nWhen you run this script, it:\n\n1. Logs into YNAB (API) and fetches your accounts and last reconciled dates\n2. Logs into American Express (Puppeteer) and performs the One-Time Password process automatically (uses IMAP)\n3. Fetches CSV data from American Express\n4. Converts it into zero duplicate, YNAB format and imports through YNAB API\n\nBeing zero input and stateless, this script requires your YNAB AMEX accounts to be named the same as on American Express. It will tell you what it was unable to map so you can make the adjustments... or, fork your own version of this and allow for user input.\n\n## Required Environment Variables\n\nYou must supply the variables below. The budget ID can be found when logged into YNAB in your URL bar, and for the token you will need to create a YNAB API token. IMAP information is for the OTP flow, **and you will need to make sure email is enabled for your OTP options on your AMEX account**.\n\nYou can put this in a `.env` file or supply as environment variables normally.\n\n`LOCAL=true` This is what determines if you are running a browser off your display or a hidden virtual one through xvfb (versus headless which is prone to detection).\n\n```\nYNAB_API_KEY=ynabapitokenhere\nBUDGET_ID=123123-0b123-12a1-1a23-123b1a234a\nLOCAL=true\nAMEX_USER=AmexUsername\nAMEX_PASS=am3xP4ssw0rd!\nIMAP_USERNAME=username@domain.com\nIMAP_PASSWORD=em@ilP4ssw0rd123!\nIMAP_INCOMING_HOST=imap.domain.com\nIMAP_INCOMING_PORT=993\nIMAP_TLS=true\n```\n\n### One more note...\n\nPlease be responsible, and don't try to run this every 5 minutes. I get that it's fun, but the last thing you want is an IP ban from American Express. Just run this once a day, like Plaid would if it would ever work. Hopefully OAuth rolls out soon.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGraysonCAdams%2Famex-ynab-import","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGraysonCAdams%2Famex-ynab-import","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGraysonCAdams%2Famex-ynab-import/lists"}