> For the complete documentation index, see [llms.txt](https://docs.api.market/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.api.market/api-product-docs/magicapi/image-upload-api.md).

# 🏞️ Image Upload API

**Developer Protal :** <https://api.market/store/magicapi/image-upload>

<figure><img src="/files/erDnPvnDtXoZt9GL0qxk" alt=""><figcaption></figcaption></figure>

The Image Upload API provides a free and efficient solution for uploading images and retrieving secure URLs to access these images once uploaded. This service is designed for rapid deployment and ease of use, ideal for developers and businesses requiring a no-cost solution for temporary image hosting.

**Key Features:**

* **No Cost**: This API is completely free to use, making it accessible to developers and businesses of all sizes.
* **Automatic Deletion**: Images are automatically deleted after 7 days from the date of upload, ensuring that storage is managed efficiently without manual intervention.
* **Secure Uploads**: Each request must be authenticated using an API key, ensuring that only authorized users can upload images.
* **Immediate Access**: Upon successful upload, the API immediately provides a URL to access the uploaded image, facilitating instant use in user applications.
* **Scalability**: Designed to handle high volumes of requests without degradation in performance, suitable for both small projects and large-scale operations.
* **Calls:** This API gives 1,000,000 Calls/Month and Free of cost that means it almost never runs out for any developer who needs to store their Image free of cost and access it through an URL.

**How to Use the API:**

1. **Set Up Authentication**: Ensure you have your API key (hidden for security purposes), which is required to authenticate your upload requests. Include this API key in the header of each request.\
   \
   For Example - `'x-magicapi-key: YourAPIKeyHere'`<br>
2. **Upload an Image**: Use the following `curl` command to upload an image file. Replace `path_to_image.png` with the path to the image you want to upload:

```bash
curl -X 'POST' \
  'https://api.magicapi.dev/api/v1/magicapi/image-upload/upload' \
  -H 'accept: application/json' \
  -H 'x-magicapi-key: YourAPIKeyHere' \
  -H 'Content-Type: multipart/form-data' \
  -F 'filename=@"/path_to_image.png;type=image/png"'
```

\
**Example**: If you're uploading a screenshot named `Screenshot 2024-06-17 at 3.00.57 PM.png` located on your desktop, your command would look like this:

```bash
curl -X 'POST' \
  'https://api.magicapi.dev/api/v1/magicapi/image-upload/upload' \
  -H 'accept: application/json' \
  -H 'x-magicapi-key: YourAPIKeyHere' \
  -H 'Content-Type: multipart/form-data' \
  -F 'filename=@"/Users/yourusername/Desktop/Screenshot 2024-06-17 at 3.00.57 PM.png;type=image/png"'
```

**Handle the Response**: A successful upload will return a JSON object containing the URL of the uploaded image. Here's an example of what the response might look like:

```json
{
  "url": "https://d3tx3wg2jy0sui.cloudfront.net/4870f6f90c624419a57d917048584d80.png"
}
```

You can use this URL in your application to display the image or link to it. Remember that the image will be deleted automatically after 7 days.

**Security Considerations**:

* Always keep your API key confidential to prevent unauthorized access.
* Monitor usage to detect any abnormal activities, which may indicate security issues.

This API is a powerful tool for developers needing a reliable and efficient way to manage image uploads and retrievals, providing robust functionality with minimal setup, all at no cost.

Try out this API and store and use your images through a URL here at <https://api.market/store/magicapi/image-upload>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.api.market/api-product-docs/magicapi/image-upload-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
