Thanks!
So does the first snippet work after upgrading mp-api? If not, please post the error message.
Note that in the second snippet, MPDataRetrieval seems to be using the legacy API which means you’ll have to use the legacy API key for it and you’ll also obtain outdated data. The continue using legacy the API endpoint would have to be changed to legacy.materialsproject.org explicitly. The better solution would be to update MPDataRetrieval to use the mp-api client directly. Tagging @ardunn here to help with matminer.