How to use Summarization API with Python in 5 minutes?
Tags: summarization, ai, api, python
Published: 2023-01-10 14:15:45

_In this tutorial, you will learn how to use Summarization API in 5 minutes using Python and Eden AI API. Eden AI provides a unique, easy and developer-friendly API that allows you to summarize texts with the provider of your choice._

## **What is Summarization ?**
Much like [Keyword Extraction](https://www.edenai.co/post/top-10-keyword-extraction-api?referral=how-to-summarization-python), [Summarization](https://www.edenai.co/feature/summarization?referral=how-to-summarization-python) uses machine learning with [Natural Language Processing (NLP)](https://www.edenai.co/post/best-natural-language-processing-apis?referral=how-to-summarization-python) to break down human language so that it can be understood and analyzed by machines. It is a technique that automatically sums up a long text while capturing the essence of its content : the important topics, expressions and words.

Summarization APIs are ideal for students, teachers, or anyone in the academic field dealing with large amounts of content on a daily basis. For instance, it can be used to condense research papers into shorter, more readable briefs.

**[Try Eden AI for FREE](https://app.edenai.run/user/register?referral=how-to-summarization-python)**

## Getting Started with Summarization API

The first step to using Summarization API is to install Python's requests package that will allow you to call Eden AI API.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9cg04c7p2uyq1ujysy90.png)
Next, you'll need to install Python's JSON package in order to read and print the result of the API request.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nqk7x22fwix3ecjy1o8f.png)

## **How to use Summarization in Text with Python**

You are now ready to process text into Eden AI Summarization API. You can use Summarization in many languages (here is the [list of languages supported for Summarization.)](https://docs.edenai.co/reference/text_summarize_create?referral=how-to-summarization-python)

### **1. Get a Summarization API Key on Eden AI**

To perform Summarization, you'll need to create an account on [Eden AI](https://app.edenai.run/user/register?referral=how-to-summarization-python). Then, you will be able to get your **API key** direclty from the homepage with free credits offered by Eden AI.

![Eden AI platform - Get your API key](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k0h6l5feb7jy9ygdr0uw.png)

[*Get your API key for FREE*](https://app.edenai.run/user/register?referral=how-to-summarization-python)

### **2. Start summarizing your text**

Now that you have imported packages on Python and got your API key, you will be able to summarize your text. With Eden AI, you can choose from a wide range of engines you want for Summarization. Here is the [list of Summarization APIs available on Eden AI](https://docs.edenai.co/reference/text_summarize_create?referral=how-to-summarization-python) to help you choose the provider that best suits your project and needs.

Here is the Python script you need to write on your notebook:
![Summarization API with Python](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/13gfr1rscq3a19yzy20j.png)
As shown in the script, we have called two different Summarization engines. Eden AI API will then return in its JSON response results of those providers.
Once the request is done, you will be able to get the result with this print:
![Summarization API with Python](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0rb9jufbk8r0jiiwjlrr.png)
Here is an example of a Summarization API response:
![Summarization API with Python](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c0wfaqx1y02x7yg4rro1.png)

## Benefits of using Summarization API with Eden AI

Using Summarization with Eden AI API is quick and easy. Plus, by aggregating several Summarization engines on a single API, our platform lets you use a number of these engines at the same time depending on the document you wish to summarize.

![Best Summarization engines in one API](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pzqi2agn8hd4ylep3r36.gif)

**Save time and cost**

We offer a unified API for all providers: simple and standard to use, with a quick switch between providers and an access to the specificic features of each provider.

**Easy to integrate**

The JSON output format is the same for all suppliers thanks to Eden AI's standardisation work. The response elements are also standardised thanks to Eden AI's powerful matching algorithms.

**Customization**

With Eden AI you have the possibility to integrate a third party platform: we can quickly develop connectors. To go further and customize your Summarization request with specific parameters, check out our [documentation](https://docs.edenai.co/reference/text_summarize_create?referral=how-to-summarization-python).

**[Create your Account on Eden AI](https://app.edenai.run/user/register?referral=how-to-summarization-python)**