Blocked from MP because of intensive querying?

Hello, I am encountering issues when querying using my API key (legacy version). Here is the error I get after 5-6 materials:

MPRestError: REST query returned with error status code 403. Content: b’\n\n\n\n \n\nAttention Required! | Cloudflare\n\n\n\n\n\n\n\nbody{margin:0;padding:0}\n\n\n\n\n\n\n\n\n\n

\n
Please enable cookies.
\n
\n
\n

Sorry, you have been blocked

\n

You are unable to access materialsproject.org

\n
\n\n
\n
\n
\n \n \n \n
\n
\n
\n\n
\n
\n
\n

Why have I been blocked?

\n\n

This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.

\n
\n\n
\n

What can I do to resolve this?

\n\n

You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.

\n
\n
\n
\n\n
\n

\n Cloudflare Ray ID: 7d32e4006c54a253\n \n \n Your IP:\n Click to reveal\n 204.19.71.2\n \n \n Performance & security by Cloudflare\n \n

\n \n
\n\n\n
\n
\n\n \n\n\n\n’

I haven’t been given an email address so I am asking on this forum, is it possible to circumvent this limitation ?

Hi @Yasmine_Benabed, thanks for reporting this. I just put in an exception for our legacy API to bypass the Cloudflare block. Please try again. I’d also recommend switching to our new API and python client at your earliest convenience.

Hello Patrick, thank you for your reply. Our cluster administrator is not present at the moment and he is the only person authorized to install a new version of python, I will switch to python 3.8 as soon as he is back.

Unfortunately I tried again and it returns the same error message after 5 materials.

@Yasmine_Benabed We generally advise to download all the data you need via our API client once, write the results to a file and subsequently use that file in the analyses on your cluster. That would also allow you to run the MPRester from mp-api.client or pymatgen.ext.matproj in the python environment of your choice. Note that our legacy API will be retired soon, so this would probably be a good opportunity to switch :slight_smile: Is there any particular reason keeping you from switching to our new API?

PS Looks like you’re running pymatgen/2022.0.17. Upgrading python should allow you to upgrade your pymatgen version, too. Using your new API key with a recent pymatgen version will automatically redirect you to our new API. The data served through the legacy API is outdated and won’t be updated anymore.

Hi Patrick, thank you for your reply. In order to use your new API, I need python 3.8 and I am currently running on python 3.7. Our cluster administrator is not present at the moment and he is the only person authorized to install a new version of python, I will switch to python 3.8 as soon as he gets back. I am trying to make it work in the meantime.

If you don’t mind, I might get back to you via email to have more details on how to efficiently download the data I need.

Thank you for all your help !

1 Like

Thread closed due to inactivity, please open a new thread to address related issues.