Copy this prompt and paste it into ChatGPT, Claude, or any AI assistant to quickly integrate the API:
I want to integrate an Email Extraction API into my application. Here are the details:
API ENDPOINT
------------
Method: GET
URL: http://localhost:8000/api/email-extract
PARAMETERS
---------
- key (required): API key for authentication
- url (required): Target website URL to extract emails from
- headless (optional): boolean, enable headless browser
- force_refresh (optional): boolean, bypass cache
CURL EXAMPLES
-------------
# Basic request
curl "http://localhost:8000/api/email-extract?key=YOUR_API_KEY&url=https://example.com"
# With headless browser
curl "http://localhost:8000/api/email-extract?key=YOUR_API_KEY&url=https://example.com&headless=true"
# Force refresh cache
curl "http://localhost:8000/api/email-extract?key=YOUR_API_KEY&url=https://example.com&force_refresh=true"
RESPONSE FORMAT
---------------
Success (200):
{
"url": "https://example.com",
"final_url": "https://www.example.com/",
"title": "Example Domain",
"emails": [
{
"email": "contact@example.com",
"source": "mailto",
"score": 90
}
],
"from_cache": false,
"processing_time": 0.523,
"total_emails": 1,
"timestamp": "2025-01-06T10:00:00Z"
}
STATUS CODES
------------
200: Success
400: Bad Request (missing/invalid parameters)
401: Unauthorized (invalid/disabled API key)
429: Rate Limit Exceeded
500: Internal Server Error
INTEGRATION HELP
---------------
Please help me integrate this API into my project. My API key is: DEBUG_KEY_FOR_TESTING
Python Code Example
import requests
def extract_emails(url, api_key="DEBUG_KEY_FOR_TESTING"):
"""Extract emails from a website using the Email Extraction API"""
api_url = "http://localhost:8000/api/email-extract"
params = {
"key": api_key,
"url": url
}
response = requests.get(api_url, params=params)
response.raise_for_status()
data = response.json()
print(f"Found {data['total_emails']} emails")
for email_info in data['emails']:
print(f" - {email_info['email']} (source: {email_info['source']})")
return data
# Usage example
if __name__ == "__main__":
result = extract_emails("https://example.com")
print(f"Final URL: {result['final_url']}")
print(f"Title: {result['title']}")