# Get

## Search our index and retrieve a list of documents

### Parameters:

| Name           | Optional / Required | Data type         | Description                                                                                                                                                          | Default                                                                                                       |
| -------------- | ------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| q              | required            | String            | A keyword to search for                                                                                                                                              |                                                                                                               |
| in             | optinal             | String            | Search keyword in fields author, title, description or tags                                                                                                          | author, title, description, tags                                                                              |
| op             | optional            | String            | Search keyword with "and" or "or" operator                                                                                                                           | or                                                                                                            |
| offset         | optional            | Integer           | Retrieve rows at position X (min. 0)                                                                                                                                 | 0                                                                                                             |
| limit          | optional            | Integer           | Retrieve X rows (min. 0 and max. 100)                                                                                                                                | 10                                                                                                            |
| return\_fields | optional            | String            | Customize the responses by setting the return fields (id, url, short\_url, image\_small, image\_medium, image\_big, language, title, description, tags, embed\_code) | id, url, short\_url, image\_small, image\_medium, image\_big, language, title, description, tags, embed\_code |
| sort           | optional            | String            | Sort results (views\_desc, views\_asc, create\_date\_desc, create\_date\_asc, pages\_desc, pages\_asc)                                                               |                                                                                                               |
| language       | optional            | String            | Filter result (de, en, ...)                                                                                                                                          |                                                                                                               |
| pages          | optional            | String or integer | Filter result from 10 to 20 pages (10-20) or exact 30 pages (30)                                                                                                     |                                                                                                               |
| views          | optional            | String or integer | Filter result with 500 to 1000 views (500-1000) or exact 800 views (800)                                                                                             |                                                                                                               |
| create\_date   | optional            | String            | Filter result which got created from 2013-09-01 between 2013-09-30 (2013-09-01-2013-09-30) or on an exact date 2013-09-01 (2013-09-01)                               |                                                                                                               |
| category       | optional            | Integer           | Filter result (1, 2, ...)                                                                                                                                            |                                                                                                               |

### Demo

&#x20;URL Find your token on - [yumpu.com](https://www.yumpu.com/en/account/profile/api) Token&#x20;

&#x20;q&#x20;

#### Optional parameters:

&#x20;in  op  offset  limit  return\_fields  sort  language  pages  views  create\_date  category&#x20;

Add optional parametersRun request

```
```

{% tabs %}
{% tab title="curl" %}
Example:

```
curl -X GET -H "X-ACCESS-TOKEN: YOUR_ACCESS_TOKEN" "https://search.yumpu.com/2.0/search.json?q=s.moser&in=author"
```

{% endtab %}

{% tab title="PHP" %}
Example:

```php
require_once('../yumpu.php');
$yumpu = new Yumpu();
$data = array(
    'q' => 's.moser',
    'in' => 'author'
);
$search = $yumpu->search($data);
print_r($search);
?>
```

{% endtab %}

{% tab title="JavaScript" %}
Example:

```javascript
var yumpu = require('yumpu');
yumpu.setToken('yourToken');
var parameters = '{
  q: 's.moser',
  in: 'author'
}';
yumpu.search(parameters, function(statusCode, document){
   console.log('Status: ' + statusCode);
   console.log(document);
});
```

{% endtab %}

{% tab title="Java" %}
Example:

```java
Yumpu y = new Yumpu("your access token");
String[] params = {"q=s.moser", "in=author"};
System.out.println(y.search(params));
```

{% endtab %}
{% endtabs %}

Whatever language you are using, the result will be the same.

```bash
{
   "total": 813,
   "documents": [
     {
       "id": "42025",
       "url": "https://www.yumpu.com/en/document/view/42025/google-eric-schmidt-at-the-milken-institute-global-conference",
       "short_url": "https://www.yumpu.com/s/iMWmtU3n9y8d8gup",
       "image": {
         "small": "https://images001.yumpu.com/yumpu.com/5647/1335778383_6815/thumb/page000001.jpg",
         "medium": "https://images001.yumpu.com/yumpu.com/5647/1335778383_6815/small/page000001.jpg",
         "big": "https://images001.yumpu.com/yumpu.com/5647/1335778383_6815/zoom/page000001.jpg"
       },
       "language": "en",
       "title": "Google Eric Schmidt at the Milken Institute Global Conference",
       "description": "Google Eric Schmidt at the Milken Institute Global Conference",
       "tags": [
         "google",
         "eric",
         "schmidt",
         "milken",
         "institute",
         "global",
         "conference",
         "www.yumpu.com"
       ],
       "embed_code": "iframe"
     },
     {
       "id": "23231",
       "url": "https://www.yumpu.com/en/document/view/23231/vw-collision-repair-facilities-list-1121",
       "short_url": "https://www.yumpu.com/s/VGWt63UNawxMH13U",
       "image": {
         "small": "https://images001.yumpu.com/yumpu.com/4038/1335447967_952/thumb/page000001.jpg",
         "medium": "https://images001.yumpu.com/yumpu.com/4038/1335447967_952/small/page000001.jpg",
         "big": "https://images001.yumpu.com/yumpu.com/4038/1335447967_952/zoom/page000001.jpg"
       },
       "language": "en",
       "title": "VW Collision Repair Facilities List 11.21",
       "description": "VW Collision Repair Facilities List 11.21",
       "tags": [
         "collision",
         "body",
         "center",
         "auto",
         "shop",
         "avenue",
         "street",
         "repair",
         "none",
         "paint",
         "facilities",
         "list",
         "www.yumpu.com"
       ],
       "embed_code": "iframe"
     },
     {
        ...
     }
   ],
   "state": "success"
 }
```
