If your needs include creating a screenshot of a specific webpage, the GET request method is your best bet. This method is user-friendly and ideal for requests that require minimal input parameters, perfect for quick captures of single web pages.
For more complex tasks, such as taking screenshots of multiple resources like entire websites or several URLs, the POST request method is highly recommended. It handles large data volumes better and provides flexibility in managing extensive screenshot operations.
To assist in your decision-making process, consider the following nuances of each method:
Discover implementation examples and detailed guidelines on our Screenshot Patterns page, designed for both GET and POST methods.
Both GET and POST requests permit customization through parameters that enhance the versatility of your screenshots such as the image quality, output format, and scope of capture (full page).
Here's how you can structure your parameters:
GET requests will accept parameters using the query string as shown below. Note: Ensure that the &url=...
parameter is placed at the end of the query string, otherwise its variables may conflict with the parameters in the web request.
// Line breaks added for readability GET https://api.addscreenshots.com/screenshots
?apikey=YOUR_API_KEY
&quality=80
&format=jpeg
&fullpage=true
&url=https://example.com
POST requests will accept parameters using the query string and/or the JSON (Content-Type: application/json) body as shown below:
POST https://api.addscreenshots.com/screenshots?apikey= YOUR_API_KEY&quality=80
{
"url": "https://example.com",
"format": "jpeg",
"fullpage": true
}
GET is superb for real-time response scenarios, delivering screenshots immediately as they are generated - ideal for applications requiring quick visual content retrieval.
However, for extensive screenshot tasks covering numerous pages or entire domains, POST is superior due to its ability to handle substantial data without browser timeout issues.
Each method serves distinct needs, making our API versatile for varied applications. Learn more about the practical applications and ensure to follow best practices for optimizing your API usage.