API Documentation
Overview
The api.siteprofile.io API allows you to fetch real-time data and generate content based on specified prompts. Use GET for simple prompts and POST for more complex prompts.
Authentication
You need an API key to use this API. Ensure you include it as a query parameter (api_key
).
Base URL
https://api.siteprofile.io
#Quick Start
Step 1: Prepare Your API Key
Ensure you have your API key ready. You can get it here
Step 2: Send a GET Request
Endpoint:
GET /?url=<URL>&api_key=<API_KEY>
Parameters:
url
(required): The URL to fetch data from.api_key
(required): Your API key.device
(optional): The device type to simulate (e.g., "desktop", "mobile").json_mode
(optional): Specify if you need the LLM response in JSON mode (e.g., "true", "false").p
(optional): The prompt to generate content.
Example Request:
curl "https://api.siteprofile.io/?
url=https%3A%2F%2Fsimilarweb.com
&api_key=<your_api_key>
&p=What%20are%20the%20core%20functions%20of%20this%20website%3F"
This will quickly allow you to experience how the API works with a simple prompt.
If you need to use a more complex structure for your prompt, you should use the POST method to pass the 'prompt' parameter. Please refer to the following content.
Detailed Usage with POST
Step 1: Prepare Your API Key and URL
Ensure you have your API key and the URL you want to fetch data from.
Step 2: Send a POST Request
Endpoint:
POST /?url=<URL>&api_key=<API_KEY>&device=<DEVICE>&json_mode=<JSON_MODE>
Parameters:
url
(required): The URL to fetch data from.api_key
(required): Your API key.device
(optional): The device type to simulate (e.g., "desktop", "mobile").json_mode
(optional): Specify if you need the LLM response in JSON mode (e.g., "true", "false").
Body:
prompt
(required): The prompt to generate content.
Example Request:
curl -X POST "https://api.siteprofile.io/?url=https://example.com
&api_key=your_api_key&device=desktop&json_mode=true"
-H "Content-Type: application/json" \
-d '{
"prompt": "
- product feature:Main functions and features of the product
result as JSON format:
{"product_features": [{"title": str, "description": str}]}
[Important]: Only return a single piece of valid JSON text."
}'
Response
The response will be in JSON format and include the fetched data along with the generated content based on your prompt.
Example Response:
{
"status": "ok",
"home_screenshot": {
"desktop_screenshot_base64": "data:image/jpeg;base64,/9j/4AAQSkZ...",
"mobile_screenshot_base64": ""
},
"data": {...},
"generate_result": "LLM generated content here...",
}
}
Error Handling
If an error occurs, the response will include a status of failed
and a message describing the error.
Example Error Response:
Notes
- Validate your URL and API key before making a request.
- Ensure your API usage is within limits.
- Use GET for simple prompts and POST for more complex prompts to ensure proper handling and response.
The Simplest API to Access the Most Comprehensive Website Information.
© Copyright 2024. All rights reserved.