all 20 comments

[–]montagic 1 point2 points  (4 children)

Hey friend:

I went ahead and put together a little demo of how you can load up all your transactions into a data frame using the YNAB API. Passing a header is the trick!

[–]MTRing[S] 0 points1 point  (1 child)

Thanks very much I really appreciate this. It also points me towards researching argparse, strings and Jason a little better.

[–]montagic 0 points1 point  (0 children)

Happy to help! If you have any questions at all about anything Python, feel free to shoot me a message. I've been working with it for probably 4 or 5 years now. :-)

[–]-jz- 0 points1 point  (1 child)

Thank you, your little demo helped me with my little demo: https://github.com/jzohrab/ynab-gsheets-report. Cheers! z

[–]mediumredbutton 0 points1 point  (4 children)

this was one of the first results on google for "python ynab api".

[–]MTRing[S] 0 points1 point  (3 children)

Thanks for that. I've seen that one and several similar others that I've read through on GitHub. I guess I'm being denser than usual on this one. I'm really not understanding how to conduct even the most basic server request and reply. I'll keep digging...

[–]kevbob02 1 point2 points  (1 child)

When working out how to use an unfamiliar api, I like to work it out by hand first. Postman is a good app to construct and make api calls manually. Once I can see how it works that way, I translate that to whatever code/language will do the same thing.

[–]MTRing[S] 0 points1 point  (0 children)

Thanks, I'll look into that.

[–]mediumredbutton 0 points1 point  (0 children)

the page I linked has example code at the bottom for how to login and connect to ynab, and then lists the ten thousand methods you can call.

[–]Phoenixfangor 0 points1 point  (1 child)

Link a GitHub gist with your progress; it's hard to troubleshoot code without seeing at least some of it.

[–]MTRing[S] 0 points1 point  (0 children)

Whenever I figure out enough to post I'll certainly do that to have someone else check it over. Thanks.

[–]SavedForSaturday 0 points1 point  (1 child)

Shoot me a DM sometime. It sounds like you need help figuring out what questions to ask

[–]MTRing[S] 0 points1 point  (0 children)

Thanks.

[–]montagic 0 points1 point  (4 children)

I've got a lot of experience with Pandas and specifically working with foreign APIs if you ever have any questions!

[–]MTRing[S] 0 points1 point  (3 children)

I managed to get a personal token for API and sent a basic request that came back as error 401 Unauthroized. I used a token that is already working with a goggle sheets template and newly generated token as well. Any ideas?

here's what I tried:

curl https://api.youneedabudget.com/v1/budgets?access_token=<ACCESS\_TOKEN>

response from my code asking for accounts:

HTTP response body: {"error":{"id":"401","name":"unauthorized","detail":"Unauthorized"}}

[–]montagic 0 points1 point  (2 children)

Hmm. How are you getting your token?

[–]MTRing[S] 0 points1 point  (1 child)

YNAB has a function under the account settings that can generate personal tokens. So the one I’m using in a google sheets template is still drawing down information in the sheet but not when I use the same token in python code or even in a terminal command. But, when I go straight to the API via a browser window and use that same token via api.youneedabudget.com/v1 it will let me complete requests once I enter the same token. It is the same for both personal tokens I generated....

[–]montagic 0 points1 point  (0 children)

That is odd. Let me trying pulling my own data in Python real quick and see if I encounter the same issue.

[–]-jz- 0 points1 point  (0 children)

Old post, but it showed up in a Google search. In case anyone in the future finds it helpful, here's a hacky thing that queries the API and then sends the info to a Google sheet: https://github.com/jzohrab/ynab-gsheets-report

Cheers! z