{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/pt/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Limites de taxa","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"limites-de-taxa","__idx":0},"children":["Limites de taxa"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A API MoreLogin impõe limites de taxa para garantir o uso justo e a estabilidade do sistema."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"limites","__idx":1},"children":["Limites"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Tipo de API"},"children":["Tipo de API"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Limite de taxa"},"children":["Limite de taxa"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Janela"},"children":["Janela"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["API local"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["120 solicitações"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["por minuto"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["API aberta"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["120 solicitações"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["por minuto"]}]}]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"resposta-de-limite-de-taxa","__idx":2},"children":["Resposta de limite de taxa"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Quando você excede o limite de taxa, a API retorna:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Status HTTP"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["429 Too Many Requests"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"code\": 429,\n  \"msg\": \"Rate limit exceeded\",\n  \"data\": null,\n  \"requestId\": \"...\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"melhores-práticas","__idx":3},"children":["Melhores Práticas"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"1-implementar-nova-tentativa-com-retirada","__idx":4},"children":["1. Implementar nova tentativa com retirada"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"import time\nimport requests\n\ndef api_request_with_retry(url, payload, max_retries=3):\n    for attempt in range(max_retries):\n        response = requests.post(url, json=payload)\n        if response.status_code == 429:\n            wait_time = 2 ** attempt  # 1s, 2s, 4s\n            print(f\"Rate limited. Retrying in {wait_time}s...\")\n            time.sleep(wait_time)\n            continue\n        return response\n    raise Exception(\"Max retries exceeded\")\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"2-operações-em-lote","__idx":5},"children":["2. Operações em lote"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Em vez de fazer chamadas de API individuais, use endpoints em lote quando disponíveis:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"# Bad: 100 individual calls\nfor env_id in env_ids:\n    requests.post(f\"{BASE}/api/env/start\", json={\"envId\": env_id})\n\n# Good: Use batch endpoints\nrequests.post(f\"{BASE}/api/env/updateGroup/batch\", json={\n    \"envIds\": env_ids,\n    \"groupId\": \"target-group\"\n})\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"3-respostas-de-cache","__idx":6},"children":["3. Respostas de cache"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Para dados que não mudam com frequência (por exemplo, listas de fuso horário, listas de plataformas), armazene a resposta em cache localmente:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"# Cache timezone/language data — it rarely changes\ntimezone_data = requests.post(f\"{BASE}/api/env/advanced/timezone\").json()\n# Reuse timezone_data for subsequent profile creations\n","lang":"python"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"monitorando-seu-uso","__idx":7},"children":["Monitorando seu uso"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Acompanhe a frequência de chamadas da API. Se você se aproximar consistentemente do limite, considere:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Distribuindo solicitações uniformemente ao longo do minuto"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Usando webhooks (em breve) em vez de pesquisas"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Combinando múltiplas operações em chamadas em lote"]}]}]},"headings":[{"value":"Limites de taxa","id":"limites-de-taxa","depth":1},{"value":"Limites","id":"limites","depth":2},{"value":"Resposta de limite de taxa","id":"resposta-de-limite-de-taxa","depth":2},{"value":"Melhores Práticas","id":"melhores-práticas","depth":2},{"value":"1. Implementar nova tentativa com retirada","id":"1-implementar-nova-tentativa-com-retirada","depth":3},{"value":"2. Operações em lote","id":"2-operações-em-lote","depth":3},{"value":"3. Respostas de cache","id":"3-respostas-de-cache","depth":3},{"value":"Monitorando seu uso","id":"monitorando-seu-uso","depth":2}],"frontmatter":{"seo":{"title":"Limites de taxa"}},"lastModified":"2026-06-10T11:47:34.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/pt/api-reference/getting-started/rate-limits","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}