✨
PacketEngine API Docs
  • Welcome!
  • Quick Start
  • Reference
    • API Reference
      • Authentication
      • Domains
      • Subdomains
      • IPs
Powered by GitBook
On this page
  • Install the library
  • Make your first request
  • Retrieve all subdomains associated with a domain

Quick Start

PreviousWelcome!NextAPI Reference

Last updated 7 months ago

Your API requests are authenticated using API tokens. Any request that doesn't include an API token will return an error.

You can generate an API token from your Account at any time:

Install the library

The best way to interact with our API is to use one of our official libraries:

# Install via go
go mod init
go get github.com/PacketEngine/packetengine

Make your first request

To make your first request, send an authenticated request to the subdomains endpoint. This will fetch all the subdomains of a domain.

Retrieve all subdomains associated with a domain

GET https://api.packetengine.co.uk/v1/domains/{domain}/subdomains

Path Parameters

Name
Type
Description

domain*

String

The domain to fetch subdomains for

Headers

Name
Type
Description

Accept

String

application/json

Accept

String

text/plain

{
  "subdomains": [
    "e.z.kohls.com",
    "k2mz07.kohls.com",
    "sli.kohls.com",
    "fusionbctest.kohls.com",
    "wcs-delivery-prod-gt.kohls.com",
    "b2b.gtm-ext.kohls.com",
    "static-qa.lle-mcommerce.kohls.com",
    "www-static-pky-staging.kohls.com",
    "decc-kronos-gt.kohls.com",
    "mta5.s.kohls.com",
    "dprodn-green-snbui-bot.kohls.com"
  ]
}
{"error":"Not found"}

Take a look at how you might call this method using our official libraries, or via curl:

curl -s https://api.packetengine.co.uk/v1/domains/kohls.com/subdomains
    -H 'Accept: text/plain'
    -H "Authorization: Bearer Your-API-Token" 
// Set your API key and domain before making the request
package main

import (
    "fmt"
    "github.com/PacketEngine/packetengine"
)

var packetengineClient *packetengine.PacketEngineClient

func main() {
   packetengineClient, err := packetengine.NewPacketEngineClient("your_api_token_here")

    if err != nil {
        fmt.Println(err)
        return
    }

    withoutTags := ""
    subdomains, err := packetengineClient.GetSubdomains("kohls.com", withoutTags)
    if err != nil {
        fmt.Println(err)
        return
    }

    for _, subdomain := range subdomains {
        println(subdomain)
    }
}

https://packetengine.co.uk/user/api-tokens