Skip to content

API

The DiamondTracker API is a REST API that uses HTTPS protocol for secure communication. All endpoints follow RESTful conventions and return responses in JSON format.

Base URL: https://api.dm.diamondmatch.org/

Key

To generate an API key, click on your user name in the top right corner and go to My Profile, or open this link.

You can assign an optional tag to your API keys, which is useful if you are managing multiple keys. The key will automatically expire after the selected duration. Keys with a duration of No Limit will not expire automatically but can be manually revoked.

The API key should be included in the headers of the request as x-api-key

Endpoints

The latest documentation on our endpoints can be accessed in this link.

Pagination

Most of the endpoints that return an array of items, can and should be paginated. This can be achieved by adding the page and size variables in the query parameters of the request.

Usage

curl -X GET "https://api.dm.diamondmatch.org/v2/external/users" \
    -H "x-api-key: YOUR_KEY" \
    -H "Content-Type: application/json"
import requests

response = requests.get(
    "https://api.dm.diamondmatch.org/v2/external/users",
    headers={"x-api-key": "YOUR_KEY"}
)
print(response.json())
fetch("https://api.dm.diamondmatch.org/v2/external/users", {
headers: {
    x-api-key: "YOUR_KEY",
},
})
.then((response) => response.json())
.then((data) => console.log(data));
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

client := &http.Client{}
req, _ := http.NewRequest("GET", "https://api.dm.diamondmatch.org/v2/external/users", nil)
req.Header.Add("x-api-key", "YOUR_KEY")

resp, _ := client.Do(req)
defer resp.Body.Close()

body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
import java.net.http.*;
import java.net.URI;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.dm.diamondmatch.org/v2/external/users"))
    .header("x-api-key", "YOUR_KEY")
    .build();

HttpResponse<String> response = client.send(request,
    HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.dm.diamondmatch.org/v2/external/users");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "x-api-key: YOUR_KEY",
    "Content-Type: application/json"
]);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);
print_r($data);
?>
require 'net/http'
require 'json'

uri = URI('https://api.dm.diamondmatch.org/v2/external/users')
request = Net::HTTP::Get.new(uri)
request['x-api-key'] = 'YOUR_KEY'
request['Content-Type'] = 'application/json'

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end

puts JSON.parse(response.body)