This is a basic example of querying the RCSB PDB using the new (2021) search API with a Python 3 program and json file. I'm not affliated with the PDB, but when I was learning how to use the new search API I wished there was a simple Python example posted somewhere so I made one.
You will need:
- Python 3 (this was made using 3.7.2)
- requests, json, and pprint (I believe you can pip install each of these if you don't already have them)
Instructions:
- Download the python programs and json file from this repository.
- Make sure all files are saved in the same directory.
- Navigate to that directory and execute the Python programs. For example "python pdb_api_query_example_for_github_json_in_script.py"
Notes:
- This was only tested in a Windows environment.
- Again, I am not affliated with the PDB, if you have questions about querying or results you should contact them.
- Here's a link to their "Web Services Overview" page with more info, a link to their documentation, and a contact link at the bottom: https://www.rcsb.org/pages/webservices