kagisearch/kagi-docs

API return Unauthorized even provided with api key

Closed this issue · 1 comments

larme commented

Description

api request return an unauthorized response. I'm on a legacy profession plan and also have positive api balance.

Steps to Reproduce

export TOKEN=<api token>
curl -v -H "Authorization: Bot $TOKEN" https://kagi.com/api/v0/search\?q=steve+jobs

Expected Behavior

return 200 response

Current Behavior

return Unauthorized

*   Trying 2600:1901:0:daa1:::443...
* Connected to kagi.com (2600:1901:0:daa1::) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=kagi.com
*  start date: Feb 10 13:44:25 2023 GMT
*  expire date: May 11 13:44:24 2023 GMT
*  subjectAltName: host "kagi.com" matched cert's "kagi.com"
*  issuer: C=US; O=Let's Encrypt; CN=R3
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x55742ec492e0)
> GET /api/v0/search?q=steve+jobs HTTP/2
> Host: kagi.com
> user-agent: curl/7.74.0
> accept: */*
> authorization: Bot <api token>
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
* Connection state changed (MAX_CONCURRENT_STREAMS == 100)!
< HTTP/2 401
< x-request-id: e5236901-746a-4cbb-8b2e-7cf068a14508
< cache-control: no-store
< content-type: application/json
< content-length: 12
< date: Mon, 03 Apr 2023 10:52:12 GMT
< via: 1.1 google
< alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
<
* Connection #0 to host kagi.com left intact
Unauthorized------------
z64 commented

Hi @larme! Thank you for your interest.

As noted in our documentation, the Search API is currently only available to Team plan subscribers, which we are currently not accepting new customers for at this time.

We are currently evaluating our pricing and strategy for the Search API to make it available for everyone. Please stay tuned for updates on this.