API-referens

API för validering av ads.txt och sellers.json API-referens

Validera poster i ads.txt och app-ads.txt och bekräfta säljare mot sellers.json. Använd denna referens för att välja en operation och integrera dess dokumenterade svarskontrakt.

Operationer

GET /v1/ads-txt Visa API-referens

GET /v1/ads-txt

Operation: getAdsTxt Credits och autentisering: 2-5 Autentisering krävs
GET /v1/ads-txt Krediter: 2-5

Frågeparametrar

Parameter Typ obligatorisk
url string obligatorisk
file string
Tillåtna värden ads.txtapp-ads.txt
Standard ads.txt
valfri
verify_sellers boolean valfri

Svarsfält

Fält Typ
domain string
file string
url string
checked_at string
status string
reason string | null
fetch object
fetch.http_status integer | null
fetch.final_url string | null
fetch.bytes integer
fetch.truncated boolean
summary object
summary.records integer
summary.direct integer
summary.reseller integer
summary.ad_systems integer
summary.records_truncated boolean
summary.no_authorized_sellers boolean
variables object
records[] object[]
records[] object
records[].line integer
records[].ad_system string
records[].account_id string
records[].relationship string
records[].certification_authority_id string | null
issues[] object[]
issues[] object
issues[].code string
issues[].count integer
issues[].lines[] integer[]
sellers object
sellers.systems_total integer
sellers.systems_checked integer
sellers.confirmed integer
sellers.confidential integer
sellers.type_mismatch integer
sellers.seller_not_found integer
sellers.unknown integer
sellers.systems[] object[]
sellers.systems[] object
sellers.systems[].ad_system string
sellers.systems[].sellers_json string
sellers.systems[].reason string | null
sellers.systems[].records_checked integer
sellers.results[] object[]
sellers.results[] object
sellers.results[].ad_system string
sellers.results[].account_id string
sellers.results[].relationship string
sellers.results[].state string
sellers.results[].seller_type string | null
sellers.results[].seller_name string | null
sellers.results[].seller_domain string | null
sellers.results[].match string | null

Exempelbegäran

curl -H "X-API-Key: $DOMSCAN_API_KEY" "https://domscan.net/v1/ads-txt?url=https%3A%2F%2Fexample.com&file=ads.txt&verify_sellers=false"
const response = await fetch("https://domscan.net/v1/ads-txt?url=https%3A%2F%2Fexample.com&file=ads.txt&verify_sellers=false", {
  headers: { "X-API-Key": process.env.DOMSCAN_API_KEY },
});
const data = await response.json();
console.log(data);
import os
import requests

response = requests.get(
    "https://domscan.net/v1/ads-txt?url=https%3A%2F%2Fexample.com&file=ads.txt&verify_sellers=false",
    headers={"X-API-Key": os.environ["DOMSCAN_API_KEY"]},
)
print(response.json())
package main

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

func main() {
	req, err := http.NewRequest(http.MethodGet, "https://domscan.net/v1/ads-txt?url=https%3A%2F%2Fexample.com&file=ads.txt&verify_sellers=false", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("X-API-Key", os.Getenv("DOMSCAN_API_KEY"))

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	data, err := io.ReadAll(resp.Body)
	if err != nil {
		panic(err)
	}
	fmt.Println(resp.Status, string(data))
}
require "json"
require "net/http"

uri = URI("https://domscan.net/v1/ads-txt?url=https%3A%2F%2Fexample.com&file=ads.txt&verify_sellers=false")
request = Net::HTTP::Get.new(uri)
request["X-API-Key"] = ENV.fetch("DOMSCAN_API_KEY")

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

Exempelsvar

{
  "domain": "example.com",
  "file": "ads.txt",
  "url": "https://example.com/ads.txt",
  "checked_at": "2026-10-13T12:00:00.000Z",
  "status": "found",
  "reason": null,
  "fetch": {
    "http_status": 200,
    "final_url": "https://example.com/ads.txt",
    "bytes": 20603,
    "truncated": false
  },
  "summary": {
    "records": 2,
    "direct": 1,
    "reseller": 1,
    "ad_systems": 2,
    "records_truncated": false,
    "no_authorized_sellers": false
  },
  "variables": {
    "ownerdomain": [
      "example.com"
    ]
  },
  "records": [
    {
      "line": 3,
      "ad_system": "google.com",
      "account_id": "pub-1234567890",
      "relationship": "DIRECT",
      "certification_authority_id": "f08c47fec0942fa0"
    },
    {
      "line": 4,
      "ad_system": "openx.com",
      "account_id": "537120563",
      "relationship": "RESELLER",
      "certification_authority_id": null
    }
  ],
  "issues": [
    {
      "code": "duplicate_record",
      "count": 1,
      "lines": [
        9
      ]
    }
  ],
  "sellers": {
    "systems_total": 2,
    "systems_checked": 2,
    "confirmed": 1,
    "confidential": 0,
    "type_mismatch": 0,
    "seller_not_found": 0,
    "unknown": 1,
    "systems": [
      {
        "ad_system": "google.com",
        "sellers_json": "unknown",
        "reason": "too_large",
        "records_checked": 1
      },
      {
        "ad_system": "openx.com",
        "sellers_json": "ok",
        "reason": null,
        "records_checked": 1
      }
    ],
    "results": [
      {
        "ad_system": "google.com",
        "account_id": "pub-1234567890",
        "relationship": "DIRECT",
        "state": "unknown",
        "seller_type": null,
        "seller_name": null,
        "seller_domain": null,
        "match": null
      },
      {
        "ad_system": "openx.com",
        "account_id": "537120563",
        "relationship": "RESELLER",
        "state": "confirmed",
        "seller_type": "INTERMEDIARY",
        "seller_name": "Example Exchange",
        "seller_domain": "exchange.example",
        "match": "exact"
      }
    ]
  }
}

HTTP-statuskoder

  • 200 OK
  • 400 Felaktig begäran
  • 401 Obehörig
  • 402 Betalning krävs
  • 429 För många begäranden

Referensresurser