Search code examples
pythonemailrapidapi

create email with python


im working in a personal project that needs new email in the start, and i want create a new email with python also i don't want run a complicate smtp server(I don't know much about that yet) i want do something like temp mail with api, i'd tried temp mail api but i got error i do something like this

import requests
url = "privatix-temp-mail-v1.p.rapidapi.com/request/mail/id/md5 of my temp mail"
req = request.get(url)
print(req)

but i got 401 status code that says your api key is invalid then i go to rapidapi website and see examples there was a header for req so i put that to my code that was like:

import requests
url = "https://privatix-temp-mail-v1.p.rapidapi.com/request/mail/id/md5"
headers = {
    'x-rapidapi-host': "privatix-temp-mail-v1.p.rapidapi.com",
    'x-rapidapi-key': "that was a key"
    }
req = request.get(url, headers=headers)

then i got this

{"message":"You are not subscribed to this API."}

now i get confused and i don't know what is problem if you know temp mail api or something liks this service or any suggest pls help me


Solution

  • In order to use any API from RapidAPI Hub, you need to subscribe to that particular API. It's pretty simple.

    Go to the Pricing Page of this API and choose a plan according to your need. Click on the subscribe button and you will be good to go. However, the Basic plan is free but a soft limit is associated with it so it may ask for your card details.