CINXE.COM
Product Hunt API Documentation
<!DOCTYPE html> <html> <head> <title>Product Hunt API Documentation</title><link rel="canonical" href="https://api.producthunt.com/v2/docs" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta name="description" content="Product Hunt is a curation of the best new products, every day. Discover the latest mobile apps, websites, and technology products that everyone's talking about." /><meta property="fb:app_id" content="1467820943460899" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:site" content="@producthunt" /><meta name="twitter:title" content="Product Hunt API Documentation" /><meta name="twitter:description" content="Product Hunt is a curation of the best new products, every day. Discover the latest mobile apps, websites, and technology products that everyone's talking about." /><meta name="twitter:image" content="https://url2png.producthunt.com/v6/P5329C1FA0ECB6/b3f78d9b207d4b3977b6d84fcf5fe5c3/png/?url=https%3A%2F%2Fapi.producthunt.com%2Fv2%2Fdocs" /><meta name="twitter:creator" content="@producthunt" /><meta property="og:site_name" content="Product Hunt" /><meta property="og:title" content="Product Hunt API Documentation" /><meta property="og:type" content="article" /><meta property="og:image" content="https://url2png.producthunt.com/v6/P5329C1FA0ECB6/b3f78d9b207d4b3977b6d84fcf5fe5c3/png/?url=https%3A%2F%2Fapi.producthunt.com%2Fv2%2Fdocs" /><meta property="og:description" content="Product Hunt is a curation of the best new products, every day. Discover the latest mobile apps, websites, and technology products that everyone's talking about." /><meta property="og:locale" content="en_US" /><meta property="og:url" content="https://api.producthunt.com/v2/docs" /> <link rel="stylesheet" href="https://assets.producthunt.com/assets/api-28c3d5660dbcc50ab5eaff0ff6c5a951e20723a3de29d99e14fe7836eab9e774.css" media="all" /> <script src="https://api.producthunt.com/jquery-3.6.0.min.js"></script><script src="https://api.producthunt.com/jquery-ujs-1.2.3-rails.js"></script> <meta name="csrf-param" content="authenticity_token" /> <meta name="csrf-token" content="mq8ADbZSlgsuPv2YAlUt-wK-c-Quet01T6Ig87iAlRTkyOG5wL05foxaqqxUHwtEBrHwsN_yJjywDwDE-U5Nfg" /> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1"> </head> <body> <header class="api-docs-header"> <div class="container"> <a class="api-docs-header--logo" href="https://www.producthunt.com"> <svg width="40" height="40" viewbox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="M40 20c0 11.046-8.954 20-20 20S0 31.046 0 20 8.954 0 20 0s20 8.954 20 20" fill="#DA552F"></path><path d="M22.667 20H17v-6h5.667c1.656 0 3 1.343 3 3s-1.344 3-3 3m0-10H13v20h4v-6h5.667c3.866 0 7-3.134 7-7s-3.134-7-7-7" fill="#FFF"></path></g></svg> <h1 class="api-docs-header--logo--title">Product Hunt</h1> </a> <a class="api-docs-header--api" href="/v2/oauth/applications">API dashboard</a> </div> </header> <main class="page-main"> <div class="main-content"> <div class="container p-api-v1-docs"> <ul class="api--sidenav"> <li class="api--sidenav--heading"> <a href="/v2/docs">Welcome to the API</a> </li> <li> <li class="api--sidenav--heading"> <a href="#" data-collapsing-navigation-target="OAuth User Authentication"> OAuth User Authentication </a> </li> <ul class="api--sidenav--subnav" data-collapsing-navigation="OAuth User Authentication"> <li> <a target="" href="/v2/docs/oauth_user_authentication/oauth_authorize_ask_for_access_grant_code_on_behalf_of_the_user">oauth#authorize - Ask for access grant code on behalf of the user</a> </li> <li> <a target="" href="/v2/docs/oauth_user_authentication/oauth_token_use_the_access_grant_code_you_received_through_the_redirect_to_request_an_access_token">oauth#token - Use the access grant code you received through the redirect to request an access token</a> </li> <li> <a target="" href="/v2/docs/oauth_user_authentication/oauth_test_add_the_access_token_as_header_to_any_request">oauth#test - Add the access_token as header to any request</a> </li> <li> <a target="" href="/v2/docs/oauth_user_authentication/unauthorized_oauth_oauth_test_invalid_access_tokens_will_lead_to_error_messages">unauthorized_oauth: oauth#test - Invalid access_tokens will lead to error messages</a> </li> </ul> </li> <li> <li class="api--sidenav--heading"> <a href="#" data-collapsing-navigation-target="OAuth Client Only Authentication"> OAuth Client Only Authentication </a> </li> <ul class="api--sidenav--subnav" data-collapsing-navigation="OAuth Client Only Authentication"> <li> <a target="" href="/v2/docs/oauth_client_only_authentication/oauth_token_ask_for_client_level_token">oauth#token - Ask for client level token</a> </li> <li> <a target="" href="/v2/docs/oauth_client_only_authentication/oauth_test_use_the_client_level_token_for_read_api_access">oauth#test - Use the client level token for read api access</a> </li> <li> <a target="" href="/v2/docs/oauth_client_only_authentication/unauthorized_oauth_oauth_test_invalid_access_to_user-level_content_with_just_an_client_level_token_will_lead_to_errors">unauthorized_oauth: oauth#test - Invalid access to user-level content with just an client level token will lead to errors</a> </li> </ul> </li> <li> <li class="api--sidenav--heading"> <a href="#" data-collapsing-navigation-target="GraphQL"> GraphQL </a> </li> <ul class="api--sidenav--subnav" data-collapsing-navigation="GraphQL"> <li> <a target="_blank" href="http://api-v2-docs.producthunt.com.s3-website-us-east-1.amazonaws.com/operation/query/">API Reference</a> </li> <li> <a target="_blank" href="https://ph-graph-api-explorer.herokuapp.com/">API Explorer</a> </li> </ul> </li> <li> <li class="api--sidenav--heading"> <a href="#" data-collapsing-navigation-target="Rate Limits"> Rate Limits </a> </li> <ul class="api--sidenav--subnav" data-collapsing-navigation="Rate Limits"> <li> <a target="" href="/v2/docs/rate_limits/headers">Headers</a> </li> </ul> </li> </ul> <div class="api--content"> <h2>Welcome to the Product Hunt API 2.0</h2> <p> The goal of this API is to provide access to Product Hunt data via a simple <a href="https://graphql.org/" target="_blank">GraphQL</a> interface. </p> <p> If you have any ideas for improvements or just wanna chat about queries or mutations<br> <a href="https://github.com/producthunt/producthunt-api/issues">let us know on GitHub.</a> Remember to add <strong>v2</strong> label to the issue. </p> <h3>Not familiar with GraphQL?</h3> <p> Here are some resources that can help you get started with GraphQL. </p> <ul> <li><a href="https://graphql.org/" target="_blank">GraphQL</a> home page.</li> <li><a href="https://www.howtographql.com/" target="_blank">How To GraphQL</a> - a free and open-source tutorial to learn all around GraphQL to go from zero to production.</li> </ul> <h3>Privileges</h3> <p>There are 3 types of scopes that an application can request on behalf of the user:</p> <ul> <li><strong>Public :</strong> Access public information on Product Hunt.</li> <li><strong>Private :</strong> Access Product Hunt on behalf of the authenticated user. For e.g application will be able to read goals of the user.</li> <li><strong>Write :</strong> Take actions on Product Hunt on behalf of the user. For e.g application will be able to mark user's goals as complete/incomplete.</li> </ul> <p>For example, if you are building an application in which you need to know if a user has followed a topic, or commented on a post, you would need to request <em>`public private`</em> scope.</p> <ul> <li>By default <strong>all apps are read-only</strong> i.e they have <em>`public`</em> scope. </li> <li> As part of API 2.0 we have decided to give <strong>partial write access</strong> to third party applications depending on the use-case. If your application needs it feel free to get in touch with us at <a href="mailto:hello@producthunt.com">hello@producthunt.com</a>. Remember you would also need to request <em>`public private write`</em> scope for write functions to work. </li> <li> The Product Hunt API must not be used for commercial purposes. If you would like to use it for your business, please contact us at <a href="mailto:hello@producthunt.com">hello@producthunt.com</a>. </li> </ul> <h3>Accessing Endpoints</h3> <ul> <li>The API is reachable at <strong>https://api.producthunt.com/v2/api/graphql</strong></li> <li>Currently the API is only accessible with a provided <em>access_token</em>.</li> <li>We reserve the right to rate-limit any application if we feel you are not following <strong>fair-use</strong>.</li> <li>If you require faster access without rate limit please contact us.</li> </ul> <h3>Get started: Getting an OAuth2 token</h3> <p>Get a token on behalf of a user:</p> <ul> <li>Follow the steps in <em>OAuth User Authentication</em> oauth#authorize to receive an access_grant</li> <li>Use the access_grant in oauth#token</li> <li>Add the <em>Authorization</em> http header with the token to all requests. E.g <em>Authorization: Bearer {token}</em></li> <li>Test this and troubleshoot according to the examples in oauth#test</li> </ul> <p>Get a token without user context. (eg before a user logs in)</p> <ul> <li>Follow the steps explained in <em>OAuth Client Only Authentication</em> oauth#token</li> <li>Please remember that this tokens limit you to public endpoints that don't require user context.</li> </ul> <p>But… i just wanted to run a simple script?</p> <ul> <li>The oauth2 flow is a bit of a overkill if you just want to run a few scripts</li> <li> We provide a developer_token (does not expire, linked to your account) in the <a href="https://www.producthunt.com/v2/oauth/applications">API dashboard</a> </li> </ul> <h3>May I use the API for my business?</h3> <p> By default the Product Hunt API must not be used for commercial purposes. If you would like to use it for your business, please contact us at <a href="mailto:hello@producthunt.com">hello@producthunt.com</a>. </p> <h3>Done building? Get featured!</h3> <p> We’re excited to see what all you creative folks build and happy to feature your product on the site. Contact us at <a href="mailto:hello@producthunt.com">hello@producthunt.com</a> with its name, a couple sentence description, and link to the project. </p> <h3>Do I have to attribute Product Hunt?</h3> <p> We kindly ask that you include attribution in your project, linking back to <a href="http://www.producthunt.com">Product Hunt</a>. We’d also appreciate those that include a Product Hunt logo (it’s helpful for us!). </p> <p> You can <a href="https://s3.amazonaws.com/producthunt/ph_brand_assets.zip">download the goodies here</a>. </p> <h3>Are there any other ways to do Product Hunt Integrations?</h3> <p> Yes! There is quite a bunch of third party APIs. Blazin' fast fulltext search, SDKs with callbacks for real-time like interaction, web-hooks, etc etc. Go here for the <a href="https://github.com/producthunt/producthunt-api/wiki/Product-Hunt-APIs">full list</a>. </p> <p> Btw there is also a lot of Open Source software out there. <a href="https://github.com/producthunt/producthunt-api/wiki/Code-Examples">Take a look</a>. Maybe there is something you can reuse. </p> <h3>But…?</h3> <p> If you have any more questions, feedback, ideas or problems don’t hesitate to contact us! Also, let us know what you’re working on! Drop us a line at <a href="mailto:hello@producthunt.com">hello@producthunt.com</a>. </p> <p> Happy Hacking! </p> </div> </div> </div> </main> <script> $('[data-collapsing-navigation-target]').click(function(e) { e.preventDefault(); var subgroup = $(e.target).data('collapsing-navigation-target'); $("[data-collapsing-navigation!='" + subgroup + "']").removeClass('m-active'); $("[data-collapsing-navigation='" + subgroup + "']").toggleClass('m-active'); }); </script> </body> </html>