makeshot.ai 1767497.11.800
High-quality integration for https://makeshot.ai/
Requires Python: >=3.6

# makeshot.ai

The `makeshot.ai` library provides a streamlined interface for interacting with the makeshot.ai platform, enabling automated workflows and integration within your Python applications. This package simplifies access to core features and allows you to leverage the power of makeshot.ai programmatically.

## Installation

To install the `makeshot.ai` package, use pip:
bash
pip install makeshot.ai

## Basic Usage

Here are a few examples demonstrating common use cases for the `makeshot.ai` library:

**1. Generating a Screenshot from a URL:**
python
import makeshot.ai

api_key = "YOUR_API_KEY" # Replace with your actual API key

try:
    screenshot_url = makeshot.ai.capture_website(api_key, "https://www.example.com")
    print(f"Screenshot URL: {screenshot_url}")
except makeshot.ai.exceptions.APIError as e:
    print(f"Error: {e}")

This example demonstrates how to programmatically capture a screenshot of a specified website.  Replace `"YOUR_API_KEY"` with your actual API key obtained from the makeshot.ai platform.  Error handling is included to manage potential API issues.

**2. Converting a Web Page to PDF:**
python
import makeshot.ai

api_key = "YOUR_API_KEY" # Replace with your actual API key

try:
    pdf_url = makeshot.ai.convert_to_pdf(api_key, "https://www.example.com")
    print(f"PDF URL: {pdf_url}")
except makeshot.ai.exceptions.APIError as e:
    print(f"Error: {e}")

This snippet shows how to convert a webpage into a PDF document using the library.  Again, remember to replace `"YOUR_API_KEY"` with your valid API key.

**3. Checking Website Availability:**
python
import makeshot.ai

api_key = "YOUR_API_KEY" # Replace with your actual API key

try:
    status = makeshot.ai.check_website_status(api_key, "https://www.example.com")
    print(f"Website Status: {status}")
except makeshot.ai.exceptions.APIError as e:
    print(f"Error: {e}")

This example shows how to check the HTTP status code of a website. This can be useful for monitoring website uptime or verifying link validity.

**4. Capturing a Full-Page Screenshot:**
python
import makeshot.ai

api_key = "YOUR_API_KEY" # Replace with your actual API key

try:
    full_page_screenshot_url = makeshot.ai.capture_website(api_key, "https://www.example.com", full_page=True)
    print(f"Full Page Screenshot URL: {full_page_screenshot_url}")
except makeshot.ai.exceptions.APIError as e:
    print(f"Error: {e}")

This demonstrates capturing a full-page screenshot, ensuring the entire webpage content is captured, not just the visible portion.

**5. Specifying Custom Viewport Dimensions:**
python
import makeshot.ai

api_key = "YOUR_API_KEY" # Replace with your actual API key

try:
    custom_screenshot_url = makeshot.ai.capture_website(api_key, "https://www.example.com", viewport_width=1280, viewport_height=720)
    print(f"Custom Viewport Screenshot URL: {custom_screenshot_url}")
except makeshot.ai.exceptions.APIError as e:
    print(f"Error: {e}")

This shows how to capture a screenshot with custom viewport dimensions, allowing you to control the size and aspect ratio of the captured image.

## Features

*   **Website Screenshot Capture:** Programmatically capture screenshots of any accessible URL.
*   **Webpage to PDF Conversion:** Convert web pages into PDF documents.
*   **Website Status Monitoring:** Check the HTTP status code of websites.
*   **Full-Page Screenshot Support:** Capture entire web pages, regardless of initial visibility.
*   **Customizable Viewport:** Control screenshot dimensions through customizable viewport settings.
*   **Error Handling:** Robust error handling for seamless integration.
*   **Simple API:** Easy-to-use functions for quick integration into your Python projects.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

This project is a gateway to the makeshot.ai ecosystem. For advanced features and full capabilities, please visit: https://makeshot.ai/