GET
/
wp
/
v2
/
posts
curl --request GET \
  --url https://headlesswp.com/wp-json/wp/v2/posts
{
  "date": "2023-11-07T05:31:56Z",
  "date_gmt": "2023-11-07T05:31:56Z",
  "guid": {
    "raw": "<string>",
    "rendered": "<string>"
  },
  "id": 123,
  "link": "<string>",
  "modified": "2023-11-07T05:31:56Z",
  "modified_gmt": "2023-11-07T05:31:56Z",
  "slug": "<string>",
  "status": "publish",
  "type": "<string>",
  "password": "<string>",
  "permalink_template": "<string>",
  "generated_slug": "<string>",
  "class_list": [
    "<string>"
  ],
  "title": {
    "raw": "<string>",
    "rendered": "<string>"
  },
  "content": {
    "raw": "<string>",
    "rendered": "<string>",
    "block_version": 123,
    "protected": true
  },
  "author": 123,
  "excerpt": {
    "raw": "<string>",
    "rendered": "<string>",
    "protected": true
  },
  "featured_media": 123,
  "comment_status": "open",
  "ping_status": "open",
  "format": "standard",
  "meta": {
    "footnotes": ""
  },
  "sticky": true,
  "template": "<string>",
  "categories": [
    123
  ],
  "tags": [
    123
  ]
}

Query Parameters

context
enum<string>
default:view

Scope under which the request is made; determines fields present in response.

Available options:
view,
embed,
edit
page
number
default:1

Current page of the collection.

Required range: x >= 1
per_page
number
default:10

Maximum number of items to be returned in result set.

Required range: 1 <= x <= 100

Limit results to those matching a string.

after
string

Limit response to posts published after a given ISO8601 compliant date.

modified_after
string

Limit response to posts modified after a given ISO8601 compliant date.

author
integer[]

Limit result set to posts assigned to specific authors.

author_exclude
integer[]

Ensure result set excludes posts assigned to specific authors.

before
string

Limit response to posts published before a given ISO8601 compliant date.

modified_before
string

Limit response to posts modified before a given ISO8601 compliant date.

exclude
integer[]

Ensure result set excludes specific IDs.

include
integer[]

Limit result set to specific IDs.

search_semantics
enum<string>

How to interpret the search input.

Available options:
exact
offset
any

Offset the result set by a specific number of items.

order
enum<string>
default:desc

Order sort attribute ascending or descending.

Available options:
asc,
desc
orderby
enum<string>
default:date

Sort collection by post attribute.

Available options:
author,
date,
id,
include,
modified,
parent,
relevance,
slug,
include_slugs,
title
search_columns
enum<string>[]

Array of column names to be searched.

Available options:
post_title,
post_content,
post_excerpt
slug
string[]

Limit result set to posts with one or more specific slugs.

status
enum<string>[]

Limit result set to posts assigned one or more statuses.

Available options:
publish,
future,
draft,
pending,
private,
trash,
auto-draft,
inherit,
request-pending,
request-confirmed,
request-failed,
request-completed,
any
tax_relation
enum<string>

Limit result set based on relationship between multiple taxonomies.

Available options:
AND,
OR
categories

Limit result set to items with specific terms assigned in the categories taxonomy.

categories_exclude

Limit result set to items except those with specific terms assigned in the categories taxonomy.

tags

Limit result set to items with specific terms assigned in the tags taxonomy.

tags_exclude

Limit result set to items except those with specific terms assigned in the tags taxonomy.

sticky
any

Limit result set to items that are sticky.

ignore_sticky
any

Whether to ignore sticky posts or not.

format
enum<string>[]

Limit result set to items assigned one or more given formats.

Available options:
standard,
aside,
chat,
gallery,
link,
image,
quote,
status,
video,
audio

Response

200 - application/json
OK

The response is of type object.