Send a GET request to the /prompts/ endpoint to get a list of prompts that you have created.
import requestsurl ="https://api.keywordsai.co/api/prompts/"api_key ="YOUR_KEYWORDS_AI_API_KEY"# Replace with your actual Keywords AI API keyheaders ={"Authorization":f"Bearer {api_key}","Content-Type":"application/json"}response = requests.get(url, headers=headers)print(response.json())
You can get a single prompt by sending a GET request to the /prompts/<prompt_id>/ endpoint.
import requestsurl ="https://api.keywordsai.co/api/prompts/<prompt_id>/"api_key ="YOUR_KEYWORDS_AI_API_KEY"# Replace with your actual Keywords AI API keyheaders ={"Authorization":f"Bearer {api_key}","Content-Type":"application/json"}response = requests.get(url, headers=headers)print(response.json())