meisam-mulla/laravel-openfda

Simplified OpenFDA API for Laravel

1.0.5 2023-06-19 18:09 UTC

This package is auto-updated.

Last update: 2024-10-19 20:58:05 UTC


README

The Laravel OpenFDA package simplifies accessing the openFDA APIs, allowing users to query the API with ease. While this package is designed to be used with Laravel, it can also be used independently.

You can use this API without an API key however you will be limited to 1,000 requests per day. You can get a free API key from openFDA directly

Installation

You can install the Laravel OpenFDA package via Composer by running the following command:

composer require meisam-mulla/laravel-openfda

Usage

To use the Laravel OpenFDA package, follow the example below:

With Laravel

$response = OpenFDA::search('tylenol')->get();

// Process the response

Without Laravel

use MeisamMulla\OpenFDA\OpenFDA;

$openFDA = new OpenFDA();

$response = $openFDA->search('tylenol')->get();

// Process the response

Available Methods

The following methods are available for querying the openFDA APIs:

Available Endpoints

The Laravel OpenFDA package provides access to the following openFDA API endpoints:

Configuration

To configure the package, you can set the OPENFDA_APIKEY variable in your .env file. If the variable is set, it will be included as an authorization header in the API requests.

You can use this API without an API key however you will be limited to 1,000 requests per day. You can get a free API key from openFDA directly

Contributing

Contributions are welcome! If you encounter any issues or have suggestions for improvements, please open an issue on GitHub.

License

The Laravel OpenFDA package is open-source software licensed under the MIT license.

Acknowledgements

This package is built upon the openFDA APIs. We would like to express our gratitude to the openFDA team for providing this valuable resource.

Contact

If you have any questions or need further assistance, feel free to contact the package maintainer at mmeisam@gmail.com.