Introduction

The adstxt.com API allows you to download our latest aggregate files automatically.

Authentication

All endpoints require a valid API key. Visit your API Settings page to generate and API key. All requests must include your API key in a parameter called api_token.

Examples below do not include the `api_token` parameter but it is required.

File Downloads

This API lets you list and download any of our adstxt aggregate files. You can see view files and download them for free on your user dashboard.

List Files

Returns a list the latest files available for download. The filename and size in bytes of each file is returned.

Response Parameters

Parameters Description
prefix The path to the latest downloads
last_updated The time the files were generated
files List containing files
file Name of the file with full path
size File size in bytes
GET
/api-v1/downloads/list

Example request

$ curl -X GET 'https://www.adstxt.com/api-v1/downloads/list'

Example response

{
    "prefix": "2019/03/31/03/38/",
    "last_updated": "Sun, 31 Mar 2019 03:38:00 +0000",
    "files": [
        {
            "file": "2019/03/31/03/38/contacts.csv.gz",
            "size": 90713
        },
        {
            "file": "2019/03/31/03/38/diff.txt.gz",
            "size": 1901677
        },
        {
            "file": "2019/03/31/03/38/md5.txt",
            "size": 325
        },
        {
            "file": "2019/03/31/03/38/records.csv.gz",
            "size": 149902945
        },
        {
            "file": "2019/03/31/03/38/subdomains.csv.gz",
            "size": 7243
        }
    ]
}

Get Temporary URL

Returns a temporary URL where the file can be downloaded. Use the list files API endpoint to get the filenames.

The temporary URL is valid for 60 seconds. You must begin downloading the file within that time.

Request Parameters

Parameters Description
file (required) Name of the file (with full path) for which to get a temporary URL

Response Parameters

Parameters Description
file The name of the file you requested
temporary_url Visit this URL to download the actual file
GET
/api-v1/download/get-temporary-url

Example request

$ curl -X GET 'https://www.adstxt.com/api-v1/download/get-temporary-url?file=2019/03/31/03/38/diff.txt.gz'

Example response

{
  "file": "2019/03/31/03/38/diff.txt.gz",
  "temporary_url": "https://adstxt-export.s3.us-west-2.amazonaws.com/2019/03/31/03/38/diff.txt.gz?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJFLM55QHQBRFIXHQ%2F20190401%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20190401T033421Z&X-Amz-SignedHeaders=host&X-Amz-Expires=60&X-Amz-Signature=887ca2b1b3441a754ac6d0582e24fc5086d559a8542913811290dc90c1e84221"
}
Show examples in:
adstxt.com API Documentation