So I am actually pretty new to using the API too. Claude walked me through literally everything and I am sure it will do the same for you.
You can keep the same one for as long as you want. Changing it if you think it was exposed or regularly for safety perhaps. With one click you can get a new one though, and enter the new one into the .env file (discussed below). So changing is easy.
Click on DataMinder and API Reference. It will give you the ID and the “Key”: Do not share those in a screenshot or anywhere publicly actually.
The ID and the Key go into an .env file that will keep those private. But Claude can use that file to hook into the API.
If you use Claude Cowork or Claude Code, you know that you can dedicate a folder for Claude to work in that is sandboxed and it cannot get out of its sandbox unless you let it. You can make it ask for permission to access P123 or just monitor it and it will keep track of your API credit use. I mention that just to say that folder is probably where you will put the .env file.
So Claude sometimes needs a little coaching on say, “I want higher is better on that ranking system” but it generally knows how to use the P123 code and get what you want from P123’s API.
Ask me if you have any questions, but I think Claude will probably just do it all for you.
One note, you could for example have it hook into Polymarket’s Public API in the same folder. Or Access Yahoo’s Public API for price history. So you could, for example, get the rank of a stock in any or all of your ranking systems, and if an earnings release is near, get the odds that it will beat the consensus. That is just the beginning of the things you can pull together before you buy a stock. All with Claude helping you.
Humans are a bottleneck. I will have my Open Claw hooked to the API then multiple agents talk to each other and review each other’s work
Each open claw agent has its own skills and soul and is using open router with a model specialized on each assigned task
We will see how it goes. Some are great at research others are great at making charts or writing others are great at math, coding, or reasoning. We are not in a place yet where one model beats them all at everything. Some models cost 150 per million tokens others are free.
Jokes aside check this out. The age of agentic AI:
Coincidentally--or perhaps not?--Claude code also helped me produce a hidden Markov model to identify factor inversion regimes a few weeks ago. It was a fascinating experience.
One thing I’ve noticed since I started embracing Claude Code is that I’m "reverse learning" now. I used to study a theory, try to understand it, and then test it. Now, I hear about a theory, test it immediately with AI coding, and if it works, I go back and study it to actually learn how it works.
I can't decide if this is a good or bad leap yet...
Right. I started a Google NotebookLM on hidden Markov models today–even though I may have complete code. Another AI (NotebookLM) is also changing the way l learn.
I don't know which "mistakes" are yours and which are Gemini's, but there are some flaws here. First, total assets are never negative or close to zero so using Max(AstTotQ, 0.001) is not helpful, and if there were a chance that AstTotQ was close to 0, you'd want something like 2 or 5 there instead of 0.001. In fact, in the rare cases when AstTotQ is NA (e.g. Teekay or Dr. Reddy's or Newegg), this formula would end up giving you 1000 times the numerator alone, which really isn't what you want: those companies would rank extremely high on your second factor (this is because the Max command ignores the fact that some things in the parenthetical are NA). Second, the "PEG" ratio isn't a PEG ratio if LTGRthMean is NA since the denominators of both EBITDAYield and Yield are price; moreover, I don't see any logic in multiplying EBITDA yield by dividend yield, nor in adding dividend yield to long-term growth. It's not really a yield-adjusted formula; a yield-adjusted formula would use (EBITDAA-DivPaidA)/MktCap. It's also not a "projected" PEG ratio since it uses EBITDA rather than EBITDAEst. As for the tenth factor, there are plenty of companies that have debt now but had no debt in the PYQ: those companies will have that debt multiplied by 1000 and subtracted from the change in operating cash flow, making every single one of them go to the bottom of your ranking, all ranked by the size of their debt.
Maybe these don't qualify as mistakes? If Gemini looked over these formulas and didn't catch these flaws, then maybe it's a bad idea to rely on it.
When I said "no mistakes," I was specificaly refering to the P123 syntax.
Your feedback proves (at least to me) that Gemini is a useful tool for generating factor ideas, but human judgment is absolutely necessary to catch logical/accounting flaws. This is exactly how I use Gemini. That being said, I believe the first two flaws you pointed out could be fixed by optimizing the prompt. This is where human experience and domain knowledge become invaluable.