Skip to content

Latest commit

 

History

History
274 lines (229 loc) · 4.15 KB

endpoints-to-query.md

File metadata and controls

274 lines (229 loc) · 4.15 KB

Endpoints to Queries

Below are examples of available endpoints and corresponding queries. These examples may not be up to date and offer complete details, so viewing the schema directly would be recommended.

Browse Posts

curl "https://demo.ghost.io/ghost/api/v3/content/posts/?key=$GHOST_API_KEY" | json_pp
posts(limit: 2, page: 3) {
  edges {
    node {
      id
      featureImage
      metaDescription
      sendEmailWhenPublished
    }
  }
  pageInfo {
    hasNextPage
    hasPreviousPage
  }
  meta {
    pagination{
      limit
      next
      page
      pages
      prev
      total
    }
  }
}

Read a Post by ID

curl "https://demo.ghost.io/ghost/api/v3/content/posts/5b7ada404f87d200b5b1f9c8/?key=$GHOST_API_KEY" | json_pp
post(id: "5b7ada404f87d200b5b1f9c8") {
  id
  featureImage
  metaDescription
  sendEmailWhenPublished
  slug
}

Read a Post by Slug

curl "https://demo.ghost.io/ghost/api/v3/content/posts/slug/welcome/?key=$GHOST_API_KEY" | json_pp
post(slug: "welcome") {
  id
  featureImage
  metaDescription
  sendEmailWhenPublished
  slug
}

Browse Authors

curl "https://demo.ghost.io/ghost/api/v3/content/authors/?key=$GHOST_API_KEY" | json_pp
authors(limit: 2, page: 1) {
  edges {
    node {
      id
      profileImage
    }
  }
  pageInfo {
    hasNextPage
    hasPreviousPage
  }
  meta {
    pagination{
      limit
      next
      page
      pages
      prev
      total
    }
  }
}

Read an Author by ID

curl "https://demo.ghost.io/ghost/api/v3/content/authors/5979a779df093500228e958e/?key=$GHOST_API_KEY" | json_pp
post(id: "5979a779df093500228e9590") {
  id
  featureImage
  metaDescription
  sendEmailWhenPublished
  slug
}

Read an Author by Slug

curl "https://demo.ghost.io/ghost/api/v3/content/authors/slug/lewis/?key=$GHOST_API_KEY" | json_pp
author(slug: "cameron") {
  id
  featureImage
  metaDescription
  sendEmailWhenPublished
  slug
}

Browse Tags

curl "https://demo.ghost.io/ghost/api/v3/content/tags/?key=$GHOST_API_KEY" | json_pp
tags(limit: 2, page: 1) {
  edges {
    node {
      id
      description
    }
  }
  pageInfo {
    hasNextPage
    hasPreviousPage
  }
  meta {
    pagination{
      limit
      next
      page
      pages
      prev
      total
    }
  }
}

Read a Tag by ID

curl "https://demo.ghost.io/ghost/api/v3/content/tags/5979a779df093500228e958b/?key=$GHOST_API_KEY" | json_pp
tag(id: "5979a779df093500228e958a") {
  id
  description
  slug
}

Read a Tag by Slug

curl "https://demo.ghost.io/ghost/api/v3/content/tags/slug/speeches/?key=$GHOST_API_KEY" | json_pp
tag(slug: "fables") {
  id
  featureImage
  metaDescription
  sendEmailWhenPublished
  slug
}

Browse Pages

curl "https://demo.ghost.io/ghost/api/v3/content/pages/?key=$GHOST_API_KEY" | json_pp
pages(limit: 2, page: 1) {
  edges {
    node {
      id
      createdAt
    }
  }
  pageInfo {
    hasNextPage
    hasPreviousPage
  }
  meta {
    pagination{
      limit
      next
      page
      pages
      prev
      total
    }
  }
}

Read a Page by ID

curl "https://demo.ghost.io/ghost/api/v3/content/pages/5979a4d6df093500228e9582/?key=$GHOST_API_KEY" | json_pp
page(id: "5979a4d6df093500228e9582") {
  id
  description
  slug
}

Read a Page by Slug

curl "https://demo.ghost.io/ghost/api/v3/content/pages/slug/about/?key=$GHOST_API_KEY" | json_pp
page(slug: "about") {
  id
  description
  slug
}

Browse Settings

curl "https://demo.ghost.io/ghost/api/v3/content/settings/?key=$GHOST_API_KEY" | json_pp
settings {
  title
  description
}