WRITEUP-DB

WriteupDB API Documentation

Introduction

The WriteupDB API allows you to fetch writeups from the WriteupDB platform. You can filter results based on various parameters like search terms, author, tag, and type. The API supports pagination and sorting of results.

Base URL

The base URL for accessing the API is:

https://www.writeup-db.com/wp-json/writeupdb/v1/

Endpoints

1. Fetch Writeups

  • Endpoint: /writeups
  • Method: GET
  • Description: Retrieves unique authors along with the count of writeups submitted by each author.

HTTP Method

  • GET: Retrieve writeups based on specified criteria.

Parameters

Query Parameters

ParameterTypeDescriptionExample
pagedintPage number for pagination (default is 1)paged=2
searchstringComma-separated search terms for title, tags, program, submitter_name, or authorsearch=bug bounty, XSS
authorstringSearch term for authors (submitter_name or org_author_name)author=John Doe
tagstringSearch term for tagstag=security
typestringFilter by writeup type (e.g., ‘Bug Bounty’, ‘Cheatsheet’)type=Bug Bounty
sort_bystringColumn to sort by (allowed values: ‘id’, ‘title’, ‘publication_date’, ‘database_updated’)sort_by=title
orderstringSort order (allowed values: ‘ASC’, ‘DESC’; default is ‘DESC’)order=ASC

Response Structure

The API response includes the following fields:

FieldTypeDescription
writeupsarrayList of writeups matching the criteria
total_pagesintTotal number of pages based on the current recordsPerPage setting
current_pageintCurrent page number
total_record_countintTotal number of records matching the criteria

Writeup Object Structure

Each writeup object in the writeups array has the following structure:

FieldTypeDescription
WDBintUnique ID of the writeup
titlearrayTitle of the writeup, including the name and link
TagsarrayList of tags associated with the writeup
ProgramsarrayList of programs associated with the writeup
AuthorsarrayList of authors associated with the writeup
TypearrayType of the writeup
PublicationDatestringDate the writeup was published
AddedDatestringDate the writeup was added to the database

Example Request

GET https://www.writeup-db.com/wp-json/writeupdb/v1/writeups?paged=1&search=bug bounty, XSS&author=John Doe&tag=security&type=Bug Bounty&sort_by=title&order=ASC

Example Response

{
"writeups": [
{
"WDB": 123,
"title": [
{
"name": "Example Writeup",
"link": "https://example.com/writeup"
}
],
"Tags": ["security", "bug bounty"],
"Programs": ["Program A"],
"Authors": ["John Doe"],
"Type": ["Bug Bounty"],
"PublicationDate": "2024-01-01",
"AddedDate": "2024-02-01"
}
],
"total_pages": 10,
"current_page": 1,
"total_record_count": 250
}

2. Fetch Unique Authors

  • Endpoint: /authors
  • Method: GET
  • Description: Retrieves unique authors along with the count of writeups submitted by each author.
  • Parameters:
    • limit (optional): The maximum number of authors to return. Default is 10.
    • sort (optional): The order in which to sort the results. Can be either ASC (ascending) or DESC (descending). Default is DESC.

Request Example:

GET https://www.writeup-db.com/wp-json/writeupdb/v1/authors?limit=5&sort=ASC

Response Example:

[
{
"author": "John Doe",
"count": 15
},
{
"author": "Jane Smith",
"count": 12
},
...
]

3. Fetch Unique Programs

  • Endpoint: /programs
  • Method: GET
  • Description: Retrieves unique programs along with the count of writeups associated with each program.
  • Parameters:
    • limit (optional): The maximum number of programs to return. Default is 10.
    • sort (optional): The order in which to sort the results. Can be either ASC (ascending) or DESC (descending). Default is DESC.

Request Example:

GET https://www.writeup-db.com/wp-json/writeupdb/v1/programs?limit=5&sort=DESC

Response Example:

[
{
"program": "Program A",
"count": 20
},
{
"program": "Program B",
"count": 18
},
...
]

4. Fetch Unique Types

  • Endpoint: /types
  • Method: GET
  • Description: Retrieves unique types of writeups along with the count of each type.
  • Parameters:
    • limit (optional): The maximum number of types to return. Default is 10.
    • sort (optional): The order in which to sort the results. Can be either ASC (ascending) or DESC (descending). Default is DESC.

Request Example:

GET https://www.writeup-db.com/wp-json/writeupdb/v1/types?limit=5&sort=ASC

Response Example:

[
{
"type": "Bug Bounty",
"count": 25
},
{
"type": "Security Research",
"count": 20
},
...
]

5. Fetch Unique Tags

  • Endpoint: /tags
  • Method: GET
  • Description: Retrieves unique tags along with the count of writeups associated with each tag.
  • Parameters:
    • limit (optional): The maximum number of tags to return. Default is 10.
    • sort (optional): The order in which to sort the results. Can be either ASC (ascending) or DESC (descending). Default is DESC.

Request Example:

GET https://www.writeup-db.com/wp-json/writeupdb/v1/tags?limit=5&sort=DESC

Response Example:

[
{
"tag": "security",
"count": 30
},
{
"tag": "bug bounty",
"count": 25
},
...
]

Common Response Format

All endpoints return an array of objects, each containing the unique value and its count. The response is in JSON format.

Error Responses

If an error occurs, the API will return a JSON object with an error message and a status code.

Error Response Example:

{
"code": "rest_invalid_param",
"message": "Invalid parameter(s): sort",
"data": {
"status": 400,
"params": {
"sort": "The sort parameter must be either ASC or DESC."
}
}
}

Notes

The limit and sort parameters help you control the amount of data and its order to suit your application’s needs.

Ensure you handle the response appropriately in your application to display the data as needed.

By following this documentation, you can effectively utilize the WriteupDB REST API to fetch unique authors, programs, types, and tags with their respective counts.


Disclaimer

  • The API is provided “as is” without any warranties, express or implied. Use it at your own risk.
  • The data provided by the API is subject to change without notice. Ensure that you have appropriate mechanisms in place to handle such changes.

Legal Use Warning

  • Unauthorized or malicious use of the API is strictly prohibited.
  • Do not use the API for any activities that violate local, national, or international laws or regulations.
  • By using the API, you agree to comply with all applicable laws and regulations regarding data privacy and protection.
  • We reserve the right to limit or revoke access to the API at any time for any reason, including but not limited to violations of these terms.

Support

For any questions or issues related to the API, please contact our support team at info@writeup-db.com.