FileGrab API Documentation

Welcome to the FileGrab API Documentation. This guide provides comprehensive insights into integrating with our API for efficiently collecting information and downloading files from URLs. Below, you'll find detailed endpoints, covering request parameters, response formats, and status codes. Contact us to obtain your API key.

Base URL

https://filegrab.net/api/v1/

1. Get File Name

Retrieves the name of the file from a given URL.

API Request

  • Endpoint: /get-file-name
  • Method: POST
Parameter Type Description
url string The URL of the file.
key string The API key.

API Response

  • Content-Type: JSON
{
    "success": true|false,
    "file-name": string,   // Name of the file
    "error-code": number   // optional
}
Error Code Description
400 Invalid URL.
401 Invalid API Key.
403 Server denied access to the file at the specified URL.
404 File not found at the specified URL.
429 Too many requests. Please try again later.

2. Get File Extension And MIME Type

Get the file's extension and MIME type from the provided URL.

API Request

  • Endpoint: /get-file-type
  • Method: POST
Parameter Type Description
url string The URL of the file.
key string The API key.

API Response

  • Content-Type: JSON
{
    "success": true|false,
    "file-type": string,   // Extension of the file
    "mime-type": string,   // MIME-type of the file
    "error-code": number   // optional
}
Error Code Description
400 Invalid URL.
401 Invalid API Key.
403 Server denied access to the file at the specified URL.
404 File not found at the specified URL.
429 Too many requests. Please try again later.

3. Get File Size

Retrieves the size of the file from a given URL.

API Request

  • Endpoint: /get-file-size
  • Method: POST
Parameter Type Description
url string The URL of the file.
key string The API key.

API Response

  • Content-Type: JSON
{
    "success": true|false,
    "file-size": number,   // Size of the file in bytes
    "error-code": number   // optional
}
Error Code Description
400 Invalid URL.
401 Invalid API Key.
403 Server denied access to the file at the specified URL.
404 File not found at the specified URL.
429 Too many requests. Please try again later.

3. Check If File Can Be Downloaded

Check if the file exists at a given URL.

API Request

  • Endpoint: /check-file-downloadability
  • Method: POST
Parameter Type Description
url string The URL of the file.
key string The API key.

API Response

  • Content-Type: JSON
{
    "success": true|false,
    "file-downloadable": true|false,   // A boolean value indicating whether the file is downloadable or not.
    "error-code": number               // optional
}
Error Code Description
400 Invalid URL.
401 Invalid API Key.
403 Server denied access to the file at the specified URL.
404 File not found at the specified URL.
429 Too many requests. Please try again later.

3. Download file

Download the file from the given URL.

API Request

  • Endpoint: /download-file
  • Method: POST
Parameter Type Description
url string The URL of the file.
key string The API key.

API Response

  • Content-Type: application/octet-stream
{
    "success": true|false,
    "file-data": data,         // The data from the file.
    "error-code": number       // optional
}
Error Code Description
400 Invalid URL.
401 Invalid API Key.
403 Server denied access to the file at the specified URL.
404 File not found at the specified URL.
429 Too many requests. Please try again later.
Last Updated: 17/02/2024