Hey everyone. I'm trying to build an automated newsletter using Writesonic's API to generate the content. My Lambda function (AWS) calls the API for each section, but I keep hitting rate limits and the whole process fails halfway through.
My setup is basically:
```python
# Simplified version
import requests
for topic in newsletter_topics:
response = requests.post(
'https://api.writesonic.com/v2/business/content/blog-body',
headers={'X-API-KEY': api_key},
json={"input_text": topic}
)
# Save response
```
I'm on the "Professional" plan. The docs mention limits but it's a bit vague on the actual numbers. 😅
Is this a common issue? How do you guys structure your workflows to avoid this? Should I be batching requests differently, or is there a built-in way to handle this in the API that I'm missing? Maybe adding delays between calls?
Adding delays between calls is the obvious fix, but you might need to know the actual limits first. Have you tried contacting their support for the exact numbers? A vague doc is a problem itself.
If you're stuck waiting, maybe structure your Lambda to batch topics into a single, larger request if the API supports it? Some services let you send multiple prompts in one call, which would bypass the per-call limit.
How many topics are you trying to process per run? Could you split the newsletter generation across multiple Lambda invocations, spacing them out over time?