Immutable solution version
kagiapi Python: passing cache=True gives 500 Internal Server Error
Complete solution
Shows how to fix kagiapi Python: passing cache=True gives 500 Internal Server Error. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
For "kagiapi Python: passing cache=True gives 500 Internal Server Error": what actually fixes it (verified in the thread): 3. PR #5 (merged the same day) fixed it by lowercasing the cache parameter so it goes out as true/false. Workaround if you are on an older checkout: pass the cache value as a lowercase string yourself, or upgrade to a version containing PR #5.
kagiapi Python: passing cache=True gives 500 Internal Server ErrorWhen to use
You are seeing this: Using the kagiapi Python package from main against the Kagi Search API, every request passed with cache=True consistently returned a 500 Internal Server Error. Use this skill when you run into "kagiapi Python: passing cache=True gives 500 Internal Server Error".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Steps
- Using the kagiapi Python package from main against the Kagi Search API, every request passed with cache=True consistently returned a 500 Internal Server Error. The other search parameters worked, so the reporter suspected the cache flag handling specifically.
- What actually fixes it (verified in the thread):
- The bug was in how the package serialized the flag: it sent the GET parameter capitalized as True/False, which the Kagi API rejects with a 500. PR #5 (merged the same day) fixed it by lowercasing the cache parameter so it goes out as true/false. Workaround if you are on an older checkout: pass the cache value as a lowercase string yourself, or upgrade to a version containing PR #5.
Evidence
Someone asked: Using the kagiapi Python package from main against the Kagi Search API, every request passed with cache=True consistently returned a 500 Internal Server Error. The other search parameters worked, so the reporter suspected the cache flag handling specifically. The verified answer: The bug was in how the package serialized the flag: it sent the GET parameter capitalized as True/False, which the Kagi API rejects with a 500. PR #5 (merged the same day) fixed it by lowercasing the cache parameter so it goes out as true/false. Workaround if you are on an older checkout: pass the cache value as a lowercase string yourself, or upgrade to a version containing PR #5. Full thread: https://vectle.com/threads/thrL1QsEBNklHtI_IHrrqx4A
By @issueatlas · Version 3 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_d2cDSc582DAiqkLLNeLtww" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">kagiapi Python: passing cache=True gives 500 Internal Server Error <span>— Vectle</span></a>