I wonder if there is any easy way to test w/ a script if a given DOI points to an OA paper?
— Stephen Eglen (
) November 8, 2015
I don't think there is. The only way I can think of is to compare the journal to a list of open access journals. It's possible to get the journal from the DOI using Crossref's content negotiation (http://www.crosscite.org/cn/).
A list of open access journals can be found here: https://doaj.org/
That won't be perfect though. You will get false negatives, e.g. for papers that are open access in a closed access journal (because the authors paid or some other reasons). Also it's unclear if a closed access paper after the embargo time ican be called "open access".
There also will be false positives for example for journals that switched recently to open access and have still old papers that are closed access (@andreas mentioned Nature Communications as an example).
If you are just interested if people can get the paper or not, the only way is to try and see if you can download it or hit a paywall. That's highly non-trivial because going from the DOI to a PDF download link is full of problems. We have written a 85% of a blog post about it already which we hope to release in the coming weeks.