Skip to main content

Get blacklisted domains

Retrieve a paginated list of all blacklisted domains for the authenticated account.

Request

Endpoint

GET https://api.woodpecker.co/rest/v2/blacklist/domains

Headers

x-api-key: {YOUR_API_KEY}

For details on how to authenticate your requests, please see the authentication guide.

Parameters

ParameterRequiredDescription
pageNoRequested results page (0-based)
per_pageNoNumber of records per page. Default: 100, maximum: 1000
info

Page parameter is 0-based. Use page=0 to retrieve the first one. pagination_data.current_page_number is 1-based.

Request sample

Retrieve first 1000 domains

curl --request GET \
--url "https://api.woodpecker.co/rest/v2/blacklist/domains?page=0&per_page=1000" \
--header "x-api-key: {YOUR_API_KEY}"

Retrieve all blacklisted domains, paginate through results

import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.ArrayList;
import java.util.List;

public class WoodpeckerApiClient {
private static final String API_URL = "https://api.woodpecker.co/rest/v2/blacklist/domains";
private static final String API_KEY = "YOUR_API_KEY";

public static void main(String[] args) {
try {
List<String> allDomains = new ArrayList<>();
HttpClient client = HttpClient.newHttpClient();
ObjectMapper objectMapper = new ObjectMapper();

int page = 0;
boolean hasMorePages = true;

while (hasMorePages) {
String requestUrl = API_URL + "?page=" + page + "&per_page=1000";

HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(requestUrl))
.header("x-api-key", API_KEY)
.header("Accept", "application/json")
.GET()
.build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());

JsonNode jsonResponse = objectMapper.readTree(response.body());

if (jsonResponse.has("domains")) {
for (JsonNode domain : jsonResponse.get("domains")) {
allDomains.add(domain.asText());
}
}

JsonNode paginationData = jsonResponse.get("pagination_data");
int currentPage = paginationData.get("current_page_number").asInt();
int totalPages = paginationData.get("total_pages").asInt();

if (currentPage >= totalPages) {
hasMorePages = false;
} else {
page++;
}
}

System.out.println("Total blacklisted domains: " + allDomains.size());
allDomains.forEach(System.out::println);

} catch (Exception e) {
System.err.println("Error: " + e.getMessage());
}
}
}

Response

Response examples

A list of blacklisted domains. The domains are sorted alphabetically.

{
"domains": [
"baddomain.com",
"blacklistedomain.io",
"finisheddeal.co.uk",
"nomoreemails.co",
"notmyicp.design"
],
"pagination_data": {
"total_elements": 505,
"total_pages": 6,
"current_page_number": 6,
"page_size": 100
}
}

Body schema

FieldTypeDescription
domainsarray[string]List of blacklisted domains
pagination_dataobjectPagination information. See the pagination section

Pagination

The response body contains pagination details. It will support you in navigating through larger datasets.

Use the per_page parameter to reduce or increase the number of returned domains per page. Default value: 100, maximum value: 1000.

Use page parameter to view a specific page.

info

Page parameter is 0-based. Use page=0 to retrieve the first one. pagination_data.current_page_number is 1-based.

{
"domains": [],
"pagination_data": {
"total_elements": 501,
"total_pages": 6,
"current_page_number": 3,
"page_size": 100
}
}
FieldTypeDescription
pagination_dataobjectPagination information
└─total_elementsintegerTotal number of blacklisted domains
└─total_pagesintegerTotal number of available pages
└─current_page_numberintegerCurrent page number (1-based)
└─page_sizeintegerMaximum number of items per page