API Documentation
This documentation provides details on how to authenticate and make requests to the API.
1. Intro
This API delivers a list of projects and URLs flagged for copyright infringement in Google Search. It provides a streamlined interface to integrate our data into your systems, enhancing your ability to monitor and address copyright violations effectively.
In this documentation, you will find detailed instructions on how to interact with our API, from setting up authentication, to crafting requests and handling responses. This includes complete definitions for all available endpoints, detailed field descriptions, and numerous examples to assist you in your development journey.
We appreciate your interest in our API and look forward to supporting you in integrating our data into your applications, services, or workflows. Please review this documentation carefully, and don't hesitate to reach out if you have any questions or require further information.
2. Base URL
The base URL for the PiracyMeter API is: https://piracymeter.com/api/v1
3. Authentification
To authenticate your requests, you can use one of the available authentification methods:
using
Authorization
header;using
key
variable in the query string.
For the first authentification method, you need to include the Authorization
header with the value of Bearer
followed by your API key. The API key can be obtained from the "Account & Billing" section at piracymeter.com.
Example:
Authorization: Bearer <your-api-key>
If you prefer to define your authorization key directly in the query string, you can use the second method.
Example:
https://piracymeter.com/api/v1/projects?key=<your-api-key>
Request Headers
All requests to the Piracymeter API should include the following request header:
Accept: application/json
- Indicates that you expect the response to be in JSON format.
Authentication with Bearer Header
curl --location 'https://piracymeter.com/api/v1/projects' \
--header 'Authorization: Bearer <your-api-key>' \
--header 'Accept: application/json'
Authentication with API Key in Query String
curl --location 'https://piracymeter.com/api/v1/projects?key=<your-api-key>' \
--header 'Accept: application/json'
Remember to replace<your-api-key>
with your valid API key obtained from piracymeter.com.
4. Get Project List
/projects
path
curl --location 'https://piracymeter.com/api/v1/projects' \
--header 'Authorization: Bearer <your-api-key>' \
--header 'Accept: application/json'
Remember to replace<your-api-key>
with your valid API key obtained from piracymeter.com.
5. Get Project URLs
To retrieve the URLs for a specific project, you can make a GET request to the following endpoint:
GET /api/v1/links
curl --location 'https://piracymeter.com/api/v1/links?project_id=<project_id>' \
--header 'Authorization: Bearer <your-api-key>' \
--header 'Accept: application/json'
Remember to replace <project_id>
in the endpoint URL with the actual ID of the project you want to retrieve the URLs for, and <your-api-key>
with your valid API key obtained from piracymeter.com.
6. Pagination
The PiracyMeter API supports pagination for retrieving large sets of data. The response from the API includes information about the available pages and the ability to navigate between them.
The following query parameters can be used for pagination:
page
(optional): The page number to retrieve. Default is 1.
The response will include the following pagination information:
current_page
: The current page number.per_page
: The number of results per page.
Example response:
{
"status": "success",
"data": {
"links": {
"current_page": 1,
"per_page": 100,
"data": [
// Results for the current page
]
}
}
}
To navigate between pages, you can modify the page
query parameter in your API request. For example, to retrieve the second page of results, you can use the following URL:
GET /api/v1/projects?page=2
Remember to include the appropriate authentication headers (Authorization
and Accept
) in your API requests.
Please note that API may impose rate limits or other restrictions to ensure fair usage.
7. Error Handling
The PiracyMeter API uses standard HTTP status codes to indicate the success or failure of a request. In case of an error, additional information may be provided in the response body.
Here are some common HTTP status codes you may encounter:
200 OK: The request was successful, and the response body contains the requested data.
400 Bad Request: The request was invalid or could not be understood. Check your request parameters and format.
401 Unauthorized: The request lacks valid authentication credentials or the provided API key is invalid.
403 Forbidden: The request is valid, but the server is refusing to respond. Ensure you have the necessary permissions.
404 Not Found: The requested resource was not found. Verify the endpoint URL and resource identifiers.
429 Too Many Requests: The request exceeds the rate limits. Retry the request after a certain period.
500 Internal Server Error: An unexpected error occurred on the server. Contact the PiracyMeter support team if the issue persists.
Example error response:
{
"status": "error",
"error": {
"code": 403,
"text": "Not authorized."
}
}
8. Rate Limiting
The PiracyMeter API enforces rate limiting to ensure fair usage. The current rate limit is set to 100 requests per minute per API key. If you exceed this limit, you will receive a 429 Too Many Requests
response.
Last updated
Was this helpful?