I have a few dozen screens, many of which only generate buy signals very infrequently. Is it possible to somehow automate the Run Screen function for those Screens via some script or API, without having to open and manually select Run Screen for each of them?
Edit: I’m already using the Screen of Screens function.
You could also do a 'Screen of Screens' but you can only call up to 10 other Screens from within the new Screen. The example below runs 10 Screens and also has a column that shows you which Screen(s) the stock came from (1=True, 0=False). It looks like the only way to include a column for each Screen with the 0 or 1 is if you put them all in the same rule like this:
@Lynch:Screen("Lynch",10) or @Buffet:Screen("Buffett",10) or @CANSLIM:Screen("CANSLIM",10) or @Greenblatt:Screen("Greenblatt",10) or @ONeil:Screen("ONeil",10) or @Piotroski:Screen("Piotroski",10) or @TinyTitans:Screen("Tiny Titans",10) or @FocusOnRD:Screen("Focus on R&D",10) or @FocusonSales:Screen("Focus on Sales",10) or @PopularValues:Screen("Popular Values",10)
Following up on the API, I’m getting an error message when I attempt to use the /screen/run function. Is the Access token value the long alphanumeric “key” on the API Key page? And is the screen value the numerical value of the screen in its URL?
No. The ID/KEY pair are given to the /auth endpoint. The response contains the access token. Use that token in the Authorization header for all subsequent API calls.
You can test this directly in the API documentation.
In the right area of that section, select Try it out.
Enter your API key and ID in the request body.
Click Execute.
If the request is successful, the response will return a token. You can then use that token to authorize and test other API endpoints below on the page.
Ok, I think I got it to work. Seems like there was another step - response body text is the token? And then clicking on Post (or was it something else) in the /screen/run function?
So I see the results , but this is many more steps than just opening and screen clicking Run Screen. Is there some way to save these sequence of steps, for multiple screens, and have the results emailed to me daily? Doesn’t this require a unique token for each screen run, meaning that I’d have to do this manually for each screen every time I want to get the buy list? Or can this be implemented once and save?m I’m not a programmer so it would be best to explain this to me in the simplest terms possible. Thanks.
Yes, the response body contains an alphanumeric string, and that's your access token. You use that token to authenticate all subsequent API calls, including the screen run endpoint.
But here's the key thing to understand: those steps in the API documentation were strictly illustrative. They were meant to show you what the API can do and how its endpoints work. In practice, you wouldn't be clicking through those steps manually each time. You'd implement the same logic in a programming language like Python, where the entire sequence (authenticate, run screen, print results) happens automatically in a script.
APIs are designed to support programmatic access to the Portfolio123 platform. That means a developer would write code that handles the token, runs your screens, and could even email you the results on a schedule, all without any manual clicking.
Since you mentioned you're not a programmer, the realistic options would be to either find a developer to help you write a simple automation script, or continue using the platform's built-in screen interface directly.