Skip to main content
Gcore API calls are HTTP requests sent from a terminal or a script. Three things are needed before making the first call: a terminal application, the curl command-line tool, and an understanding of JSON — the format the API uses for both requests and responses. Environment variables and HTTP status codes are also covered below.

Choosing a tool

Different tools suit different workflows. All of them call the same Gcore API endpoints — the choice is about comfort and use case: For those new to APIs: Postman removes the need to learn terminal syntax — the GUI has fields for everything. For those already comfortable in a terminal: curl is pre-installed on most systems and needs no setup. HTTPie, VS Code REST Client, and the Cloud OpenAPI import are in Tools. Sending a request in Postman is in Use Postman. These guides use curl in all code examples because it runs on every operating system without additional installation.

Tools needed

A terminal and curl are required to follow the curl examples. Python is needed only for SDK examples.

Terminal

A terminal is a text-based interface where commands are typed and executed. It’s where all curl commands in these guides are run. Once a terminal is open, commands are typed at the prompt (usually a $ or > symbol) and run by pressing Enter.

curl

curl is a command-line tool for making HTTP requests. It comes pre-installed on macOS and most Linux distributions. On Windows, it has been pre-installed since Windows 10 version 1803. To check if curl is available, open a terminal and run:
If the output starts with curl 7.x.x or curl 8.x.x, it is installed. If the command is not found:
  • On Windows: download the installer from curl.se/windows, or install via winget: winget install curl
  • On macOS: install Homebrew, then run brew install curl
  • On Linux (Debian/Ubuntu): run sudo apt-get install curl

Python (optional)

Python is needed only for the Python SDK examples. All guides show curl and Python SDK tabs — curl works without any additional installation. To check if Python is installed:
The output should be Python 3.8 or higher. To install Python, download it from python.org or use a package manager. Install the Gcore SDK with:

curl command structure

Every curl command in these guides follows the same pattern:
Breaking this down: For a GET request (reading data), -X GET, -H "Content-Type: ...", and -d are not needed:
-X GET is the default, so it can be omitted.

JSON responses

The Gcore API responds in JSON — a text format that represents structured data. Every response is either a single object ({...}) or a list of objects ([...]). Example response from listing projects:
Reading this:
  • "count": 1 — there is 1 project total
  • "results": [...] — an array containing the projects
  • "id": 1234567 — the project’s numeric ID
  • "name": "Default" — the project’s display name
When a guide says “save the id from the response”, it means: find the id field in the terminal output and use that number in the next command.

Environment variables

An environment variable stores a value in the terminal session. Instead of pasting the API token into every command, it is set once and reused:
Environment variables are session-scoped — closing the terminal window loses all variables set with export, so the next session requires setting them again. To persist across sessions on macOS/Linux, add the export line to ~/.zshrc (or ~/.bashrc) and restart the terminal. On Windows PowerShell, add it to the profile file.

HTTP status codes

The first thing the API sends back is a status code — a three-digit number indicating whether the request succeeded: