GopeedGopeed

API Integration

Use the Gopeed HTTP API and official SDKs to create and manage download tasks.

Gopeed provides an HTTP API interface for external use, allowing for download management through the API.

Enable API

First, you need to set the communication protocol to TCP. Go to Settings -> Advanced -> Communication Protocol and set the communication protocol to TCP. Then, set the IP and port as shown in the figure below:

Image

You can set any port, but be careful not to use ports that are already in use or reserved by the system, as this may cause access failures.

After that, you can access the API through http://127.0.0.1:9999. For security reasons, it is recommended to set a token. Go to Settings -> Advanced -> API Token and set a token as shown in the figure below:

Image

Note: The above settings take effect after a restart.

Using JS SDK

Gopeed provides an official js library, which needs to be installed first by running npm install @gopeed/rest:

npm install @gopeed/rest

Then you can use it happily, for example:

import { Client } from "@gopeed/rest";

(async function () {
  // Create a client
  const client = new Client();
  // Create a task
  const res = await client.createTask({
    req: {
      url: "https://example.com/file.zip",
    },
  });
})();

More usages, source code and package updates are available in the official Gopeed JS repository.

Using Python SDK

A Python SDK provided by community user @tick97115115.

pip install gospeed_api

Using HTTP API

Of course, you can also directly call the API through HTTP requests. For details, please refer to the API documentation.

On this page