Skip to main content

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.

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.

Release files for opennpi-scraper 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for opennpi-scraper 0.1.1
File Size Uploaded
opennpi-scraper-0.1.1.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for opennpi-scraper 0.1.1
File Interpreter ABI Platform
opennpi_scraper-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.0 kB

Release files / opennpi-scraper-0.1.1.tar.gz

Download URL opennpi-scraper-0.1.1.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e904036f516dd75bc1f09eb76376eec73a767e8d77c43b1b36a81877e94e1da8
BLAKE2b-256 checksum
How to use checksums
0932093ca4bd65a4d8e666be460603a72388d237ffe36ff1d5cab51fbaf9ec74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release files / opennpi_scraper-0.1.1-py3-none-any.whl

Download URL opennpi_scraper-0.1.1-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d1d2649593e4d17b5df9a3ea0f672748f331673ad0ac341a9d2564b7b7b55107
BLAKE2b-256 checksum
How to use checksums
c92751cd0957b88668dec27e3140680b983c4899aaf0796d66ca99a8f5f4479c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page