Skip to main content

The `opennpi-scraper` is designed for seamless interaction with the opennpi.com page

Project description

openNPI Scraper

Introduction

The opennpi-scraper Python package enables efficient access to the OpenNPI database, facilitating detailed queries on healthcare providers and offering a streamlined interface for extracting National Provider Identifier (NPI) records. This tool is invaluable for healthcare research and data analysis, offering advanced search capabilities and detailed information retrieval.

Features

  • Advanced Search Functionality: Perform detailed searches using a variety of filters such as name, specialty, and location.
  • Detailed Information Retrieval: Access comprehensive details about individual healthcare providers and doctors.
  • User-Friendly Interface: Simplifies the extraction process with an easy-to-use API, designed for developers and researchers alike.

Installation

To install opennpi-scraper, run the following command in your terminal:

pip install opennpi-scraper

Usage

Importing the Module

Start by importing the openNPI class from the opennpi package:

from opennpi import openNPI

Creating an Instance

Create an instance of the openNPI class:

scraper = openNPI.Scraper()

Fetching Details

Retrieve detailed information about healthcare providers and doctors by their NPI numbers.

Providers

provider_info = scraper.get_provider_detail(NPI="1629848031")
print(provider_info)

Doctors

doctor_info = scraper.get_doctor_detail(NPI="8224486550")
print(doctor_info)

Returns:

  • A dictionary with the provider's or doctor's name and additional details extracted from their respective pages.

Search

Conduct searches for healthcare providers or doctors based on specific criteria.

Providers Search Parameters

Parameter Type Description
query str General search term.
taxonomy str Filter by the provider's specialty.
state str State abbreviation.
city str City name.
zip str Postal code.
page int Page number of results to query.

Returns:

  • A dictionary with doctors key containing a list of matching providers and nextPage indicating if more results are available.
advanced_results = scraper.search_providers(query="John Doe", state="CA")
print(advanced_results)

Doctors Search Parameters

Parameter Type Description
query str General search term.
specialty str Medical specialty of the doctor.
school str Medical school or university of the doctor.
organization str Organization or medical practice the doctor belongs to.
state str State abbreviation.
city str City name.
zip str Postal code.
page int Page number of results to query.

Returns:

  • A dictionary with doctors key containing a list of matching doctors and nextPage indicating if more results are available.
advanced_results = scraper.search_doctors(school="Wayne State University School of Medicine", state = 'MI')
print(advanced_results)

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opennpi-scraper-0.1.1.tar.gz (6.3 kB view hashes)

Uploaded Source

Built Distribution

opennpi_scraper-0.1.1-py3-none-any.whl (6.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page