producthunt / producthunt-api

Product Hunt API
315 stars 29 forks source link

rate limit exceeded #292

Open karakanb opened 1 year ago

karakanb commented 1 year ago

hi folks, I am the maintainer of Devo. Devo displays the PH feed on every new tab for extensions.

I have used the old API to fetch the PH data periodically and store it in S3, and the extension would pull it from there. However, I am trying to build the same structure and I am unable to, the API fails with "rate limit reached" even in the first try.

curl --location --request POST 'https://api.producthunt.com/v2/api/graphql?access_token=<my-token-here>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "query": "{
      posts {
        nodes {
          name
          tagline
          topics {
            nodes {
              name
              slug
            }
          }
          url
          commentsCount
          votesCount
          slug
          thumbnail {
            url
          }
        }
      }
    }"
}'

what am I doing wrong? this is impacting everyone having an outdated result page in Devo.

karakanb commented 1 year ago

hi @RStankov, do you think you can help me here?

davibennun commented 1 year ago

Any updates here?

SameerKeluskar commented 1 year ago

Hi, I am facing a similar issue due to API queries having higher complexity and frequently getting the following error message: _{"data":null,"errors":[{"error":"rate_limit_reached","error_description":"Sorry. You have exceeded the API rate limit, please try again later.","details":{"limit":6250,"remaining":-50,"resetin":848}}]}.

It is written in the documentation, If you require faster access without rate limit please contact us. https://api.producthunt.com/v2/docs.

Is there any way we can increase the rate limit for the '/v2/api/graphql' endpoint?

emartinek12 commented 1 year ago

Hi, I am also facing this issue while testing. I have also already reached out to hello@producthunt.com

karakanb commented 1 year ago

it is unbelievable, no one has replied for more than a month, what a great way to interact with devs for a platform that thrives on the shoulders of devs.

jtbg commented 1 year ago

@karakanb each API response includes headers with the query complexity. Use curl -v to check the response headers. That single request is not itself complex, but you can read more here

(also heads up that you are missing a closing quote in your curl command, but I assume that's just a copy/paste issue)

karakanb commented 1 year ago

@jtbg here are the response headers:

< HTTP/2 200 
< date: Wed, 24 May 2023 10:31:45 GMT
< content-type: application/json; charset=utf-8
< cf-ray: 7cc4deec4b92721e-IST
< cf-cache-status: DYNAMIC
< cache-control: max-age=0, private, must-revalidate
< etag: W/"59bf97052f4a74482aa8e9960fecd017"
< strict-transport-security: max-age=2592000; includeSubDomains; preload
< vary: Origin
< referrer-policy: strict-origin-when-cross-origin
< x-content-type-options: nosniff
< x-download-options: noopen
< x-frame-options: SAMEORIGIN
< x-permitted-cross-domain-policies: none
< x-rate-limit-limit: 25
< x-rate-limit-remaining: 25
< x-rate-limit-reset: 900
< x-request-id: 197a1ee4-49ab-4e6c-a05b-a1434c446ba6
< x-runtime: 0.438817
< x-xss-protection: 1; mode=block
< server: cloudflare
< alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400

I don't see anything about complexity here, am I missing something? the query worked the first time, it failed the next time.

karakanb commented 1 year ago

folks this is unbelievable, I have always thought you'd be incentivized for devs to integrate with your API but the sole fact that you are not even replying for 2 months is pretty disappointing. This is a huge regression in your new API and breaks the existing usecases even if they migrate, which I tried but due to this issue I couldn't. No one is replying to the emails, no one is replying to the issue, overall pretty disappointing interaction.

I have decided to remove Product Hunt integration from Devo, you can close the issue if you don't care about fixing it anymore.

erikfiala commented 1 year ago

+1 on the ridiculousness of the PH team. How can an issue be open for this long with absolutely zero communication.

dlgiovani commented 4 months ago

I just made 2 feature requests but if they don't even check bugs and issues, my hopes are fallen to the deepest well.