Toonify

FREEMIUM
By Toonify | Updated 3 days ago | Video, Images
Popularity

9.4 / 10

Latency

10,762ms

Service Level

100%

Health Check

N/A

Back to All Discussions

Error "Missing RapidAPI application key"【Not Missing】

Rapid account: Llf 226
llf226
3年前

When i just copy and paste the example then i get the error:“Missing RapidAPI application key”.

I have no idea why its not working. Can you please help me.

Greetings
Longfei Lin

here is my code

`import requests

url = "https://toonify.p.rapidapi.com/v0/toonify"
query = {
“x-rapidapi-host”: “toonify.p.rapidapi.com”,
“x-rapidapi-key”: “my key~~~~not missing”,
“accept”: “application/json”,
}
headers = {“accept”: “application/json”}
files = {“image”: open(“img.png”, “rb”)}

response = requests.request(“POST”, url, files=files, headers=headers, params=query)

print(response.json())`

Rapid account: Justinpinkney
justinpinkney Commented 3年前

Sorry, this was my fault in some terrible copy and pasting for the example. It should look like this:

import requests

url = "https://toonify.p.rapidapi.com/v0/toonify"
headers= {
"x-rapidapi-host": "toonify.p.rapidapi.com",
"x-rapidapi-key": "my key~~~~not missing",
"accept": "application/json",
}
files = {"image": open("img.png", "rb")}

response = requests.request("POST", url, files=files, headers=headers)

print(response.json())

the api key etc should be in headers not the query. I’ll update the documentation shortly. Apologies again!

Join in the discussion - add comment below:

Login / Signup to post new comments