·      ▒██▀ ▀       ▒██▀ ▀              ▀ ▀▒██             ▀ ▀███ ·
      : ▒██▀ ▓██ ▒██▀▀██▓ ▓██▀▀▒██▀▀███ ▒██▀▀██▓ ▓██▀ ▒██▀▀███ ▒██▀▀▀▀▀ :
 · ··─┼─▓██──███─▓██─▄███─███──▓██──███─▓██──────███──▓██──███─▓██──███─┼─·· ·
      │ ███▄▄██▓ ███▄▄▄▄▄▄██▓  ███▄ ███▄███▄▄███ ███▄▄███▄ ███▄███▄▄███ │
· ··──┼─────────··                defacto2.net               ··─────────┼──·· ·
      │                                                                 :
      :             ·· APPLICATION PROGRAMMING INTERFACE ··             ·

RESTful API

Basic information on how to use the Defacto2 API.

Base URL

The web server code is open sourced: github.com/Defacto2/server
The API data is available for download as a single SQL document: defacto2.net/sql/files.sql

Examples:

No authentication is required for read-only API endpoints.

Endpoints

Endpoint Method Description Example
/areacode/:code GET Get a region by the area code GET /api/v1/areacodes/212
/areacodes GET Get all area codes GET /api/v1/areacodes
/areacodes/regions GET Get all regions (provinces, states, territories) GET /api/v1/areacodes/regions
/areacodes/region/:abbr GET Get a region by abbreviation GET /api/v1/areacodes/region/CA
/areacodes/search/:query GET Lookup an area code, state, territory, etc. GET /api/v1/areacodes/search/utah
/artifact/:id GET Get details for a specific artifact by its ID GET /api/v1/artifact/af29fa4
/artifacts GET Get all artifacts (paginated) GET /api/v1/artifacts?page=1
/artifacts/new GET Get new artifacts (recently added artifacts) GET /api/v1/artifacts/new?page=1
/boards GET Get all BBS boards GET /api/v1/boards
/category/:name GET Get artifacts from any category
(demo, scenerules, magazine, etc.)
GET /api/v1/category/demo
/categories GET Get all artifact categories GET /api/v1/categories
/demozoo GET Get all Demozoo group mappings GET /api/v1/demozoo
/groups GET Get all releaser groups (paginated) GET /api/v1/groups?page=1
/magazines GET Get all scene magazines GET /api/v1/magazines
/milestones GET Get all milestones GET /api/v1/milestones
/milestones/decade/:decade GET Get milestones by decade GET /api/v1/milestones/decade/1990s
/milestones/highlights GET Get only highlighted milestones GET /api/v1/milestones/highlights
/milestones/year/:year GET Get milestones by specific year GET /api/v1/milestones/year/1995
/milestones/years/:range GET Get milestones by year range GET /api/v1/milestones/years/1990-2000
/platform/:name GET Get artifacts from any platform
(ansi, audio, dos, windows, etc.)
GET /api/v1/platform/ansi
/platforms GET Get all artifact platforms GET /api/v1/platforms
/releaser/:name GET Get artifacts for a group, magazine, board, or site GET /api/v1/releaser/razor-1911
/scener/:name GET Get specific scener details GET /api/v1/scener/dubmood
/sceners GET Get all sceners GET /api/v1/sceners
/sceners/artist GET Get all scener artists GET /api/v1/sceners/artist
/sceners/coder GET Get all scener coders GET /api/v1/sceners/coder
/sceners/musician GET Get all scener musicians GET /api/v1/sceners/musician
/sceners/writer GET Get all scener writers GET /api/v1/sceners/writer
/websites GET Get all curated websites (alphabetical) GET /api/v1/websites

Explanations

Field Type Description
description string Detailed description of the specific artifact, typically following the pattern "[Title] released by [Group] in [Year]". This field provides historical context about the original release, including the releasing group and year. Examples: "Time To Say Goodbye released by Audiofile in 2023" or "Space Quest unprotect independently released in 1987".
datePublished object Contains the original release date components (year, month, day) when available. Represents the historical date the artifact was created or published in the scene, not when it was added to Defacto2.
download.checksum string SHA384 cryptographic hash of the file content, represented as a hexadecimal string. This can be used to verify file integrity and authenticity.
download.lastModAgo string A representation of how long ago the file was last modified (e.g., "Modified 7 years ago").
download.lastModified string ISO 8601 formatted timestamp indicating when the original file was last modified, based on the file's internal metadata. This represents the historical modification date, not when it was added to Defacto2.
download.mimeType string MIME type classification of the file content (e.g., "Zip archive", "MS-DOS executable", "Plain text").
id string Unique identifier for resources for sceners and groups that use hash-based stable identifiers derived from their names to ensure consistency across API versions.
meta.comment string Additional notes, provenance, or details about the artifact.
meta.releasers array Array of two objects containing one or two releasers involved with this artifact. A releaser can be a group, magazine, BBS board or FTP site.
meta.releasers[].api string Direct API endpoint URI to access detailed information about this specific releaser.
meta.releasers[].html string Web page URI showing the releaser's profile and all their associated artifacts.
meta.releasers[].id string A unique identifier for the releaser.
meta.releasers[].name string The display name of the releaser.
meta.title string The title of the artifact without group names or release dates, often a software title, brief description or an issue number for magazines.
postedDate string ISO 8601 formatted timestamp indicating when the artifact was added to the Defacto2 database.
relationships array Array of related external resources, references, or alternate versions. Each relationship contains a link URL and a descriptive title explaining the connection to the current artifact.
relationships[].description string A brief description explaining the nature of the relationship (e.g., "Original 1982 release", Demozoo production").
relationships[].link string Full URL pointing to the related resource. This can be an external website, another Defacto2 artifact page, or any relevant online resource that provides additional context or information about the artifact.
size.bytes number Exact file size in bytes for programmatic use. Intended for calculations, comparisons, etc.
size.formatted string Human-readable representation of file size using standard units (bytes, KB, MB, GB).
statistics.totalFiles number Total count of all files associated with a scener, releaser, or category entity.
statistics.totalSize string Human-readable representation of the combined size of all files associated with the entity.
statistics.totalSizeBytes number Exact total size in bytes of all files associated with athe entity.
tags.category string Classification of the artifact type using Defacto2's tagging system.
All categories are found in http://defacto2.net/api/v1/categories
tags.description string Human-readable combination of category and platform that describes what the artifact is and its format in natural language.
tags.platform string Technical platform or format of the artifact indicating the original system or format type.
All platforms are found in http://defacto2.net/api/v1/platforms
urls.api string Direct API URI to access this artifact's detailed information.
urls.download string Direct download link for the file artifact.
For example, /d/[id] results to https://defacto2.net/d/ab3cee
urls.html string Web page URL showing detailed information about the artifact with preview capabilities.
Uses obfuscated ID format as a permanent URL. For example, /f/[id] results to https://defacto2.net/f/ab3cee
urls.thumbnail string URI to a thumbnail image preview that needs a file extension. Generally thumbnails use a .png extension. However, if the request returns a 404 NOT FOUND, a .webp maybe required.
Example, https://defacto2.net/public/image/thumb/c8e1be87-2f54-11e0-8827-cc1607e15609.webp
Some artifacts, such as tracker music files, have no thumbnails.
uuid string Unique Universally Unique Identifier for the artifact in a standard UUID format using 36 characters.

Tag API endpoints

Endpoint Description
GET /api/v1/categories Get all artifact categories with API, HTML3, and HTML URLs
GET /api/v1/category/:name Get artifacts from any category (demo, scenerules, magazine, etc.)
GET /api/v1/platforms Get all artifact platforms with API, HTML3, and HTML URLs
GET /api/v1/platform/:name Get artifacts from any platform (ansi, audio, dos, windows, etc.)

cURL Examples

curl "https://defacto2.net/api/v1/categories"

curl "https://defacto2.net/api/v1/artifacts?page=1"

curl "https://defacto2.net/api/v1/artifacts/new?page=1"

curl "https://defacto2.net/api/v1/category/releaseadvert"

curl "https://defacto2.net/api/v1/category/demo"

curl "https://defacto2.net/api/v1/platforms"

curl "https://defacto2.net/api/v1/platform/ansi"

curl "https://defacto2.net/api/v1/groups"

curl "https://defacto2.net/api/v1/demozoo"

curl "https://defacto2.net/api/v1/releaser/razor-1911"

JavaScript (Fetch) Examples

fetch('https://defacto2.net/api/v1/artifacts?page=1')
  .then(response => response.json())
  .then(data => console.log(data));

fetch('https://defacto2.net/api/v1/artifacts/new?page=1')
  .then(response => response.json())
  .then(data => console.log(data));

fetch('https://defacto2.net/api/v1/category/demo')
  .then(response => response.json())
  .then(data => console.log(data));

fetch('https://defacto2.net/api/v1/category/releaseadvert')
  .then(response => response.json())
  .then(data => console.log(data));

fetch('https://defacto2.net/api/v1/categories')
  .then(response => response.json())
  .then(data => console.log(data));

fetch('https://defacto2.net/api/v1/demozoo')
  .then(response => response.json())
  .then(data => console.log(data));

fetch('https://defacto2.net/api/v1/groups')
  .then(response => response.json())
  .then(data => console.log(data));

fetch('https://defacto2.net/api/v1/platform/ansi')
  .then(response => response.json())
  .then(data => console.log(data));

fetch('https://defacto2.net/api/v1/platforms')
  .then(response => response.json())
  .then(data => console.log(data));

Response Structure

Artifacts API endpoints return JSON with nested URL objects and comprehensive tags:

{
    "artifacts": [
        {
            "uuid": "0192e554-352c-71d5-b110-84521efd92f9",
            "filename": "LORES.zip",
            "datePublished": {
                "year": 1984,
                "month": 5,
                "day": 22
            },
            "postedDate": "2024-11-01T12:25:54.092115+11:00",
            "size": {
                "formatted": "4k",
                "bytes": 4538
            },
            "description": "LO-RES in 1984.",
            "tags": {
                "category": "demo",
                "platform": "dos",
                "description": "a demo on MS Dos"
            },
            "urls": {
                "api": "/api/v1/artifact/ad2efee",
                "download": "/d/ad2efee",
                "html": "/f/ad2efee",
                "thumbnail": "/public/image/thumb/0192e554-352c-71d5-b110-84521efd92f9"
            }
        }
    ]
}

Categories API Response

[
    {
        "id": 1,
        "name": "releaseadvert",
        "title": "release advert",
        "description": "advertisements and announcements for Scene group releases",
        "urls": {
            "api": "/api/v1/category/releaseadvert",
            "html3": "/html3/releaseadvert",
            "html": "/files/releaseadvert"
        }
    },
    {
        "id": 12,
        "name": "demo",
        "title": "demo program",
        "description": "an artistic multimedia program designed to promote a demo group or collective",
        "uri": "demo",
        "urls": {
            "api": "/api/v1/category/demo",
            "html3": "/html3/demo",
            "html": "/files/demo"
        }
    }
]

Platforms API Response

[{
    "id": 1,
    "name": "dos",
    "title": "DOS",
    "description": "Disk Operating System, the dominant PC platform of the 1980s and early 1990s",
    "urls": {
        "api": "/api/v1/platform/dos",
        "html3": "/html3/dos",
        "html": "/files/dos"
    }
},
{
    "id": 2,
    "name": "windows",
    "title": "Windows",
    "description": "Microsoft Windows operating system",
    "urls": {
        "api": "/api/v1/platform/windows",
        "html3": "/html3/windows",
        "html": "/files/windows"
    }
}]

Scener API endpoints

Endpoint Description
GET /api/v1/scener/:name Get detailed information and files for a specific scener by name
GET /api/v1/sceners Get all sceners with pagination (1000 per page)
GET /api/v1/sceners/artist Get all artist sceners
GET /api/v1/sceners/coder Get all coder sceners
GET /api/v1/sceners/musician Get all musician sceners
GET /api/v1/sceners/writer Get all writer sceners

cURL Examples

curl "https://defacto2.net/api/v1/scener/jed"

curl "https://defacto2.net/api/v1/sceners"

curl "https://defacto2.net/api/v1/sceners/artist"

curl "https://defacto2.net/api/v1/sceners/coder"

curl "https://defacto2.net/api/v1/sceners/musician"

curl "https://defacto2.net/api/v1/sceners/writer"

JavaScript (Fetch) Examples

fetch('https://defacto2.net/api/v1/scener/jed')
  .then(response => response.json())
  .then(data => console.log(data));

fetch('https://defacto2.net/api/v1/sceners')
  .then(response => response.json())
  .then(data => console.log(data));

fetch('https://defacto2.net/api/v1/sceners/artist')
  .then(response => response.json())
  .then(data => console.log(data));

Sceners API Response

{
    "sceners": [
        {
            "id": "abc123=",
            "name": "jed",
            "title": "Jed",
            "urls": {
                "api": "/api/v1/scener/jed",
                "html3": "/html3/scener/jed",
                "html": "/p/jed"
            },
            "statistics": {
                "totalFiles": 42,
                "totalSize": "12M",
                "totalSizeBytes": 12582912
            }
        }
    ],
    "page": 1,
    "totalPages": 1
}

Scener Detail Response

{
    "scener": {
        "id": "abc123=",
        "name": "jed",
        "title": "Jed",
        "urls": {
            "api": "/api/v1/scener/jed",
            "html3": "/html3/scener/jed",
            "html": "/p/jed"
        },
        "statistics": {
            "totalFiles": 42,
            "totalSize": "12M",
            "totalSizeBytes": 12582912
        }
    },
    "artifacts": [
        {
            "uuid": "d94f84dc-99dc-457c-b07e-218263e51137",
            "filename": "SIERRA.zip",
            "datePublished": {
                "year": 1987,
                "month": 10,
                "day": 1
            },
            "postedDate": "2015-06-21T11:41:02+10:00",
            "size": {
                "formatted": "2k",
                "bytes": 1750
            },
            "description": "Space Quest unprotect independently released in 1987.",
            "tags": {
                "category": "guide",
                "platform": "text",
                "description": "a text or ascii guide or how-to"
            },
            "urls": {
                "api": "/api/v1/artifact/a419f44",
                "download": "/d/a419f44",
                "html": "/f/a419f44",
                "thumbnail": "/public/image/thumb/d94f84dc-99dc-457c-b07e-218263e51137"
            }
        }
    ]
}

Releaser API endpoints

Endpoint Description
GET /api/v1/artifact/:id Get detailed information for a specific artifact
GET /api/v1/artifacts?page=1 Get all artifacts with pagination (1000 per page)
GET /api/v1/artifacts/new?page=1 Get recently added artifacts with pagination (1000 per page)
GET /api/v1/boards Get all BBS boards
GET /api/v1/groups?page=1 Get all releaser groups with pagination (1000 per page)
GET /api/v1/magazines Get all scene magazines
GET /api/v1/releaser/:name Get detailed information and files for a specific group or magazine by name
GET /api/v1/sites Get all FTP sites

cURL Examples

curl "https://defacto2.net/api/v1/artifact/af29fa4"

curl "https://defacto2.net/api/v1/artifacts?page=1"

curl "https://defacto2.net/api/v1/boards"

curl "https://defacto2.net/api/v1/groups"

curl "https://defacto2.net/api/v1/groups?page=2"

curl "https://defacto2.net/api/v1/magazines"

curl "https://defacto2.net/api/v1/releaser/big-apple-bbs"

curl "https://defacto2.net/api/v1/releaser/razor-1911"

curl "https://defacto2.net/api/v1/releaser/the-zapper"

curl "https://defacto2.net/api/v1/sites"

JavaScript (Fetch) Examples

fetch('https://defacto2.net/api/v1/artifact/af29fa4')
  .then(response => response.json())
  .then(data => console.log(data));

fetch('https://defacto2.net/api/v1/artifacts?page=1')
  .then(response => response.json())
  .then(data => console.log(data));

fetch('https://defacto2.net/api/v1/boards')
  .then(response => response.json())
  .then(data => console.log(data));

fetch('https://defacto2.net/api/v1/groups?page=2')
  .then(response => response.json())
  .then(data => console.log(data));

fetch('https://defacto2.net/api/v1/magazines')
  .then(response => response.json())
  .then(data => console.log(data));

fetch('https://defacto2.net/api/v1/releaser/big-apple-bbs')
  .then(response => response.json())
  .then(data => console.log(data));

fetch('https://defacto2.net/api/v1/releaser/razor-1911')
  .then(response => response.json())
  .then(data => console.log(data));

fetch('https://defacto2.net/api/v1/releaser/the-zapper')
  .then(response => response.json())
  .then(data => console.log(data));

fetch('https://defacto2.net/api/v1/sites')
  .then(response => response.json())
  .then(data => console.log(data));

Group Releaser API Response

{
    "releasers": [
        {
            "id": "rzjHDqmL1do=",
            "name": "razor-1911",
            "title": "Razor 1911",
            "urls": {
                "api": "/api/v1/releaser/razor-1911",
                "html3": "/html3/group/razor-1911",
                "html": "/g/razor-1911"
            },
            "statistics": {
                "totalFiles": 935,
                "totalSize": "458M",
                "totalSizeBytes": 480750960
            }
        }
    ],
    "page": 1,
    "totalPages": 4
}

Single Artifact Detail Response

{
    "artifact": {
        "uuid": "0192d253-2446-7671-8a54-7af108989675",
        "filename": "Paratrooper [DC][h1] (1982)(Orion Software, Inc.) [Action].zip",
        "datePublished": {
            "year": 1984,
            "month": 9,
            "day": 23
        },
        "postedDate": "2024-10-28T19:51:57.126415+11:00",
        "size": {
            "formatted": "7k",
            "bytes": 7136
        },
        "description": "Paratrooper released by The Duplicators in 1984.",
        "tags": {
            "category": "releaseadvert",
            "platform": "dos",
            "description": "an intro for MS Dos"
        },
        "urls": {
            "api": "/api/v1/artifact/b221338",
            "download": "/d/b221338",
            "html": "/f/b221338",
            "thumbnail": "/public/image/thumb/0192d253-2446-7671-8a54-7af108989675"
        }
    },
    "download": {
        "checksum": "811704f43c6c06cc3a74af7782e856548e2599434ba836b0314276fb271dbd7318b8e302ca549b791897de0c16d27b78",
        "lastModified": "2018-08-25T11:49:38.486+10:00",
        "lastModAgo": "Modified 7 years ago",
        "mimeType": "Zip archive"
    },
    "meta": {
        "comment": "Date of release taken from the last modification date of PARATROP.COM.",
        "title": "Paratrooper",
        "releasers": [
            {
                "id": "the-duplicators",
                "name": "The Duplicators",
                "api": "/api/v1/releaser/the-duplicators",
                "html": "/g/the-duplicators"
            }
        ],
        "preview": ""
    },
    "relationships": [
        {
            "link": "https://defacto2.net/f/a61b846/",
            "description": "Flint fireforge release"
        },
        {
            "link": "https://www.mobygames.com/game/198/paratrooper/",
            "description": "Paratrooper (Booter 1982)"
        }
    ]
}

Group Detail Response

{
    "group": {
        "id": "rzjHDqmL1do=",
        "name": "razor-1911",
        "title": "Razor 1911",
        "urls": {
            "api": "/api/v1/releaser/razor-1911",
            "html3": "/html3/group/razor-1911",
            "html": "/g/razor-1911"
        },
        "statistics": {
            "totalFiles": 935,
            "totalSize": "458M",
            "totalSizeBytes": 480750960
        },
        "websites": [
            {
                "url": "https://www.razor1911.com",
                "name": "Razor 1911",
                "working": true
            }
        ]
    },
    "artifacts": [
        {
            "uuid": "019236b3-e1fe-72b3-ac0e-a22f6034487c",
            "filename": "TOYOTA.ZIP",
            "datePublished": {
                "year": 1991,
                "month": 5,
                "day": 9
            },
            "postedDate": "2024-09-28T13:36:51.454172+10:00",
            "size": {
                "formatted": "14k",
                "bytes": 14406
            },
            "description": "Carlos Sanz Toyota Challenge released by Skillion + Razor 1911 in 1991.",
            "tags": {
                "category": "releaseadvert",
                "platform": "dos",
                "description": "an intro for MS Dos"
            },
            "urls": {
                "api": "/api/v1/artifact/ab1f158",
                "download": "/d/ab1f158",
                "html": "/f/ab1f158",
                "thumbnail": "/public/image/thumb/019236b3-e1fe-72b3-ac0e-a22f6034487c"
            }
        }
    ]
}

Website API endpoints

Endpoint Description
GET /api/v1/websites Get all curated websites in alphabetical order

cURL Example

curl "https://defacto2.net/api/v1/websites"

JavaScript (Fetch) Example

fetch('https://defacto2.net/api/v1/websites')
  .then(response => response.json())
  .then(data => console.log(data));

Websites API Response

{
    "websites": [
        {
            "title": "16colors",
            "url": "https://16colo.rs/",
            "info": "You're looking at retro computer graphics gallery. We make ANSI/ASCII art available for web display.",
            "category": "Text art scene",
            "working": true
        },
        {
            "title": "aSCII aRENA",
            "url": "https://www.asciiarena.se/",
            "info": "aSCII aRENA is a website dedicated to the art scene and the artists who create it.",
            "category": "Text art scene",
            "working": true
        },
        {
            "title": "BBS Documentary",
            "url": "http://www.bbsdocumentary.com/",
            "info": "Jason Scott's documentary about the history of the BBS.",
            "category": "Bulletin Board System",
            "working": false
        }
    ],
    "count": 68
}

Demozoo API endpoints

Endpoint Description
GET /api/v1/demozoo Get all groups with Demozoo mappings (URI, ID, and URL)

cURL Example

curl "https://defacto2.net/api/v1/demozoo"

JavaScript (Fetch) Example

fetch('https://defacto2.net/api/v1/demozoo')
  .then(response => response.json())
  .then(data => console.log(data));

Demozoo API Response

{
    "groups": [
        {
            "uri": "fairlight",
            "id": 239,
            "url": "https://demozoo.org/groups/239/"
        },
        {
            "uri": "razor-1911",
            "id": 519,
            "url": "https://demozoo.org/groups/519/"
        },
        {
            "uri": "triad",
            "id": 131111,
            "url": "https://demozoo.org/groups/131111/"
        }
    ],
    "count": 529
}

Milestone API endpoints

Endpoint Description
GET /api/v1/milestones Get all milestones
GET /api/v1/milestones/decade/:decade Get milestones by decade (e.g., 1990)
GET /api/v1/milestones/highlights Get highlighted milestones
GET /api/v1/milestones/year/:year Get milestones by specific year
GET /api/v1/milestones/years/:range Get milestones by year range (e.g., 1990-2000)

cURL

curl https://defacto2.net/api/v1/milestones

curl https://defacto2.net/api/v1/milestones/year/1995

curl https://defacto2.net/api/v1/milestones/years/1990-2000

JavaScript (Fetch)

fetch('https://defacto2.net/api/v1/milestones')
  .then(response => response.json())
  .then(data => console.log(data));

fetch('https://defacto2.net/api/v1/milestones/highlights')
  .then(response => response.json())
  .then(data => console.log(data));

Milestone endpoints return JSON format with the following structure:

[
    {
        "Title": "Milestone Title",
        "Year": 1995,
        "Month": 6,
        "Day": 15,
        "Lead": "Introduction paragraph",
        "Content": "Plain text content",
        "ContentHTML": "<p>HTML formatted content</p>",
        "Link": "https://example.com",
        "LinkTitle": "Related Link",
        "List": [
            {
                "LinkTitle": "Subtitle",
                "SubTitle": "Additional info",
                "Link": "https://example.com",
                "Forward": "Group name"
            }
        ],
        "Highlight": true,
        "Picture": {
            "Title": "Image Title",
            "Alt": "Alternative text",
            "Attribution": "Author Name",
            "License": "CC BY-SA 4.0",
            "LicenseLink": "https://license.url",
            "Webp": "image.webp",
            "Png": "image.png",
            "Jpg": "image.jpg",
            "Avif": "image.avif",
            "Webm": "video.webm"
        }
    }
]

Area code API endpoints

Endpoint Description
GET /api/v1/areacode/:code Get details for a specific area code
GET /api/v1/areacodes Get all North American Numbering Plan area codes
GET /api/v1/areacodes/region/:abbr Get region details by two-letter abbreviation
GET /api/v1/areacodes/regions Get all regions (provinces, states, territories) with their area codes
GET /api/v1/areacodes/search/:query Search for area codes or regions

cURL Examples

curl https://defacto2.net/api/v1/areacodes

curl https://defacto2.net/api/v1/areacode/212

curl https://defacto2.net/api/v1/areacodes/regions

curl https://defacto2.net/api/v1/areacodes/region/CA

curl https://defacto2.net/api/v1/areacodes/search/california

JavaScript (Fetch) Examples

fetch('https://defacto2.net/api/v1/areacodes')
  .then(response => response.json())
  .then(data => console.log(data));

fetch('https://defacto2.net/api/v1/areacodes/region/NY')
  .then(response => response.json())
  .then(data => console.log(data));

fetch('https://defacto2.net/api/v1/areacode/search/602')
  .then(response => response.json())
  .then(data => console.log(data));

Area code endpoints return JSON in the following formats:

Single Area Code

{
    "code": 212,
    "regions": ["New York"],
    "notes": "New York City, but after December 1984 it split to 212 (Manhattan and the Bronx) and 718 (Brooklyn, Queens, and Staten Island)."
}

Single Region

{
    "name": "California",
    "abbreviation": "CA",
    "areaCodes": [209, 213, 310, 408, 415, 510, 619, 707, 714, 805, 818, 909, 916]
}

Search Result

{
    "areacodes": [
        {
            "code": 602,
            "regions": ["Arizona"]
        }
    ],
    "regions": [
        {
            "name": "California",
            "abbreviation": "CA",
            "areaCodes": [209, 213, 310, 408, 415, 510, 619, 707, 714, 805, 818, 909, 916]
        }
    ]
}

Rate Limiting

No rate limiting is currently enforced on API endpoints. However, excessive requests may be temporarily blocked.

Error Codes

Status Code Description
200 OK Successful request
400 Bad Request Invalid request format
404 Not Found No milestones found for the specified criteria
500 Internal Server Error Server-side error

OpenAPI Specification

For detailed API documentation in OpenAPI format:

Download OpenAPI JSON

The OpenAPI specification provides machine-readable API documentation that can be used with tools.