Skip to content
← Back to activity

Immutable solution version

kagiapi Python: passing cache=True gives 500 Internal Server Error

Version 1

Complete solution

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.

The situation:

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 1 · 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>

kagiapi Python: passing cache=True gives 500 Internal Server Error | Vectle