Code
import requests
import urllib3
urllib3.disable_warnings()
def fetch_uniprot_data(uniprot_id):
= f"https://rest.uniprot.org/uniprotkb/{uniprot_id}.json"
url = requests.get(url, verify=False) # Disable SSL verification
response # Raise an error for bad status codes
response.raise_for_status() return response.json()
def display_uniprot_data(data):
= data.get('primaryAccession', 'N/A')
primary_accession = data.get('proteinDescription', {}).get('recommendedName', {}).get('fullName', {}).get('value', 'N/A')
protein_name = data.get('gene', [{'geneName': {'value': 'N/A'}}])[0]['geneName']['value']
gene_name = data.get('organism', {}).get('scientificName', 'N/A')
organism
= next((comment for comment in data.get('comments', []) if comment['commentType'] == "FUNCTION"), None)
function_comment = function_comment['texts'][0]['value'] if function_comment else 'N/A'
function
# Printing the data
print(f"UniProt ID: {primary_accession}")
print(f"Protein Name: {protein_name}")
print(f"Organism: {organism}")
print(f"Function: {function}")
# Replace this with the UniProt ID you want to fetch
= "O94956"
uniprot_id = fetch_uniprot_data(uniprot_id)
data display_uniprot_data(data)
UniProt ID: O94956
Protein Name: Solute carrier organic anion transporter family member 2B1
Organism: Homo sapiens
Function: Mediates the Na(+)-independent transport of steroid sulfate conjugates and other specific organic anions (PubMed:10873595, PubMed:11159893, PubMed:11932330, PubMed:12724351, PubMed:14610227, PubMed:16908597, PubMed:18501590, PubMed:20507927, PubMed:22201122, PubMed:23531488, PubMed:25132355, PubMed:26383540, PubMed:27576593, PubMed:28408210, PubMed:29871943, PubMed:34628357). Responsible for the transport of estrone 3-sulfate (E1S) through the basal membrane of syncytiotrophoblast, highlighting a potential role in the placental absorption of fetal-derived sulfated steroids including the steroid hormone precursor dehydroepiandrosterone sulfate (DHEA-S) (PubMed:11932330, PubMed:12409283). Also facilitates the uptake of sulfated steroids at the basal/sinusoidal membrane of hepatocytes, therefore accounting for the major part of organic anions clearance of liver (PubMed:11159893). Mediates the intestinal uptake of sulfated steroids (PubMed:12724351, PubMed:28408210). Mediates the uptake of the neurosteroids DHEA-S and pregnenolone sulfate (PregS) into the endothelial cells of the blood-brain barrier as the first step to enter the brain (PubMed:16908597, PubMed:25132355). Also plays a role in the reuptake of neuropeptides such as substance P/TAC1 and vasoactive intestinal peptide/VIP released from retinal neurons (PubMed:25132355). May act as a heme transporter that promotes cellular iron availability via heme oxygenase/HMOX2 and independently of TFRC (PubMed:35714613). Also transports heme by-product coproporphyrin III (CPIII), and may be involved in their hepatic disposition (PubMed:26383540). Mediates the uptake of other substrates such as prostaglandins D2 (PGD2), E1 (PGE1) and E2 (PGE2), taurocholate, L-thyroxine, leukotriene C4 and thromboxane B2 (PubMed:10873595, PubMed:14610227, PubMed:19129463, PubMed:29871943, Ref.25). May contribute to regulate the transport of organic compounds in testis across the blood-testis-barrier (Probable). Shows a pH-sensitive substrate specificity which may be ascribed to the protonation state of the binding site and leads to a stimulation of substrate transport in an acidic microenvironment (PubMed:14610227, PubMed:19129463, PubMed:22201122). The exact transport mechanism has not been yet deciphered but most likely involves an anion exchange, coupling the cellular uptake of organic substrate with the efflux of an anionic compound (PubMed:19129463, PubMed:20507927, PubMed:26277985). Hydrogencarbonate/HCO3(-) acts as a probable counteranion that exchanges for organic anions (PubMed:19129463). Cytoplasmic glutamate may also act as counteranion in the placenta (PubMed:26277985). An inwardly directed proton gradient has also been proposed as the driving force of E1S uptake with a (H(+):E1S) stoichiometry of (1:1) (PubMed:20507927)