
MagicalAPI Python SDK lets developers integrate AI-powered resume parsing, resume scoring, resume matching, and LinkedIn public data extraction into Python applications.
MagicalAPI.com
Report Bug
·
Request Feature
- What is MagicalAPI?
- What you can build
- Features
- Services
- About the Project
- Getting Started
- Usage
- Contributing
- License
What is MagicalAPI?
MagicalAPI is your AI edge in careers and data insights, Your ultimate tool for Resume Parsing, LinkedIn data and more. It offers services like:
- Resume Parsing: Extract structured data from resumes.
- LinkedIn Data Extraction: Scrape and analyze LinkedIn profiles.
- Career Insights: Gain AI-driven recommendations for career development.
- Resume parsing pipelines for HR platforms
- Candidate scoring and job matching workflows
- LinkedIn profile enrichment tools
- Recruiting automation systems
- ATS integrations
- Resume Parsing: Parse resumes to extract key information like skills, experience, and education.
- LinkedIn Profile Scraping: Extract data from LinkedIn profiles for analysis.
- Career Insights: Leverage AI to get actionable career recommendations.
- Type-Annotated and Async: Built for modern Python with type hints and asynchronous support.
- Resume Parser
- Resume Checker(Review)
- Resume Matcher(Score)
- LinkedIn Profile Scraper
- LinkedIn Company Scraper
This is a Python client that provides easy access to the MagicalAPI.com services, fully type-annotated and asynchronous.
This is an example of how you can install the client and use it in your own scripts and projects.
Install the package using pip
pip install magicalapiHere are some samples of how to use the client for each service.
At first, you have to create an object of AsyncClient like this:
frommagicalapi.clientimportAsyncClientAPI_KEY="mag_123456"client=AsyncClient(api_key=API_KEY)You can pass the API_KEY on the code, or put it on a .env file and the client will read from there.
Example of using .env file, all settings start with the prefix MAG_ and are case insensitive, so MAG_EXAMPLE, Mag_example, and mag_EXAMPLE are equal.
# .env
MAG_API_KEY="mag_1234567"So now you can leave api_key parameter empty.
frommagicalapi.clientimportAsyncClientclient=AsyncClinet()For asynchronous response delivery, you can provide a webhook_url when initializing the client. The API will send the response to your webhook endpoint instead of using the polling mechanism.
frommagicalapi.clientimportAsyncClient# Your webhook must be whitelisted in MagicalAPI panelwebhook_url="https://your-domain.com/webhook"client=AsyncClient(webhook_url=webhook_url)Important: Webhook domains must be registered in the MagicalAPI panel. For setup guide, see the webhook documentation and example.
Here is an example of how to parse a resume using Resume Parser service:
importasynciofrommagicalapi.clientimportAsyncClientfrommagicalapi.errorsimportAPIServerError, APIServerTimedoutfrommagicalapi.types.baseimportErrorResponseresume_url= (
"https://resume-resource.com/wp-content/uploads/00123-sales-professional-resume.pdf"
)
output_file_name="resume_parser.json"asyncdefmain():
try:
# the api_key will load from the .env fileasyncwithAsyncClient() asclient:
response=awaitclient.resume_parser.get_resume_parser(url=resume_url)
ifisinstance(response, ErrorResponse):
# got error from apiprint("Error :", response.message)
else:
# got response successfullyprint("credists :", response.usage.credits)
# save response in json filewithopen(output_file_name, "w") asfile:
file.write(response.model_dump_json(indent=3))
print(f"response saved to {output_file_name}")
except (APIServerError, APIServerTimedout) ase:
# handling server errorsprint(e)
exceptExceptionase:
print("An error occurred:", str(e))
asyncio.run(main())All of the methods in the client have type hints and help to simply use.
For full examples, please see the Examples Directory
Contributions are what makes the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
Here is the Contributing Guidelines. Don't forget to give the project a star! Thanks again!
Distributed under the MIT License. See LICENSE for more information.