API V1 is deprecated, Check out new API V2 here

Comments and Comment Threads

comments#index - keyset pagination (faster & recommended)

Parameters

Name Description
older Cursor-based pagination: Only works with ID. Get records older than the provided id. Note: Sort_by is ignored and applied afterwards.
newer Cursor-based pagination: Only works with ID. Get records newer than the provided id. Note: Sort_by is ignored and applied afterwards.
page Offset-based pagination: Get content of given page, starts at 1
per_page Any kind of pagination: define the amount of records sent per call (max 50)
sort_by Sort api response: Valid options: id, created_at, updated_at
order Sort api response: valid parameters are desc and asc
search[user_id] The id of a user you want to filter for. If you pass this id the user won't be nested.
search[post_id] The id of a post you want to filter for. If you pass this id the post won't be nested.

Request

Route

GET /v1/comments?newer=678

Headers

Accept: application/json
Content-Type: application/json
Authorization: Bearer your_access_token
Host: api.producthunt.com

Response

Status

200 OK

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Rate-Limit-Limit: 900
X-Rate-Limit-Remaining: 900
X-Rate-Limit-Reset: 900
ETag: W/"102ef9feb27a58a1f43eb55a54c17a60"
Last-Modified: Wed, 05 May 2021 11:39:19 GMT
Content-Type: application/json; charset=utf-8
Cache-Control: max-age=0, private, must-revalidate
Content-Length: 7011

Body

{
  "comments": [
    {
      "id": 679,
      "body": "This is like the 55th best comment ever",
      "created_at": "2021-05-05T04:39:19.341-07:00",
      "parent_comment_id": null,
      "user_id": 10245,
      "subject_id": 1530,
      "child_comments_count": 0,
      "url": "http://www.producthunt.com/posts/awesome-idea-121#comment-679",
      "post_id": 1530,
      "subject_type": "Post",
      "sticky": false,
      "votes": 0,
      "post": {
        "comments_count": 1,
        "id": 1530,
        "name": "Awesome Idea #121",
        "product_state": "default",
        "tagline": "Great new search engine",
        "slug": "awesome-idea-121",
        "votes_count": 0,
        "day": "2021-05-05",
        "category_id": null,
        "created_at": "2021-05-05T04:39:19.320-07:00",
        "current_user": {},
        "discussion_url": "http://www.producthunt.com/posts/awesome-idea-121?utm_campaign=producthunt-api\u0026utm_medium=api\u0026utm_source=Application%3A+Awesome+Oauth+App+%2383+%28ID%3A+1273%29",
        "exclusive": null,
        "featured": true,
        "ios_featured_at": false,
        "maker_inside": false,
        "makers": [],
        "platforms": [],
        "redirect_url": "http://www.producthunt.com/r/909ba854372f6c/1530?app_id=1273",
        "screenshot_url": {
          "300px": "http://placehold.it/850x850.png",
          "850px": "http://placehold.it/850x850.png"
        },
        "thumbnail": {
          "id": 1586,
          "media_type": "image",
          "image_url": "https://ph-files.imgix.net/e725170f-6326-4632-abce-c894da82e5ff?auto=format\u0026fit=crop\u0026h=570\u0026w=430",
          "metadata": {}
        },
        "topics": [],
        "user": {
          "id": 10246,
          "created_at": "2021-05-05T04:39:19.296-07:00",
          "name": "Karl User the 770th",
          "username": "producthunter766",
          "headline": "Product Hunter",
          "twitter_username": "hunter770",
          "website_url": "http://awesome.io",
          "profile_url": "http://www.producthunt.com/@producthunter766",
          "image_url": {
            "30px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "32px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "40px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "44px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "48px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "50px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "60px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "64px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "73px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "80px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "88px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "96px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "100px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "110px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "120px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "132px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "146px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "160px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "176px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "220px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "264px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "32px@2X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "40px@2X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "44px@2X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "88px@2X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "32px@3X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "40px@3X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "44px@3X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "88px@3X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
            "original": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress"
          }
        }
      },
      "user": {
        "id": 10245,
        "created_at": "2021-05-05T04:39:19.289-07:00",
        "name": "Karl User the 769th",
        "username": "producthunter765",
        "headline": "Product Hunter",
        "twitter_username": "hunter769",
        "website_url": "http://awesome.io",
        "profile_url": "http://www.producthunt.com/@producthunter765",
        "image_url": {
          "30px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "32px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "40px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "44px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "48px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "50px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "60px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "64px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "73px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "80px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "88px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "96px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "100px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "110px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "120px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "132px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "146px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "160px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "176px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "220px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "264px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "32px@2X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "40px@2X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "44px@2X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "88px@2X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "32px@3X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "40px@3X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "44px@3X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "88px@3X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "original": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress"
        }
      }
    }
  ]
}