{"__v":0,"_id":"55abdf610685ce0d0049fbbb","category":{"__v":2,"_id":"55abddeaa36ccd0d00fdebe1","pages":["55abdf610685ce0d0049fbbb","55abe40fa36ccd0d00fdebe6"],"project":"55a7aee84a33f92b00b7a150","version":"55a7aee84a33f92b00b7a153","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-07-19T17:27:06.336Z","from_sync":false,"order":3,"slug":"batch-processing","title":"Batch Processing"},"editedParams":true,"editedParams2":true,"parentDoc":null,"project":"55a7aee84a33f92b00b7a150","user":"55a7ae50bf1be93100d89df1","version":{"__v":6,"_id":"55a7aee84a33f92b00b7a153","project":"55a7aee84a33f92b00b7a150","createdAt":"2015-07-16T13:17:28.411Z","releaseDate":"2015-07-16T13:17:28.411Z","categories":["55a7aee94a33f92b00b7a154","55a7fefa3efe0c2f0074cbdf","55a8fb10c8bd450d000dd130","55a936b1cf45e1390093f362","55abddeaa36ccd0d00fdebe1","5624db675a86b423009462e1"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-07-19T17:33:21.065Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"name":"","code":"curl https://api.aylien.com/api/v1/batch \\\n   -H \"X-AYLIEN-TextAPI-Application-Key: [[app:key]]\" \\\n   -H \"X-AYLIEN-TextAPI-Application-ID: [[app:id]]\" \\\n   -F data=:::at:::\"/home/user/file\" \\\n   -F \"endpoints=sentiment\" \\\n   -F \"entities_type=text\" \\\n   -F \"output_format=xml\" \\\n   -F \"mode=tweet\"","language":"curl"}]},"results":{"codes":[{"status":200,"language":"text","code":"http://api.aylien.com/api/v1/queue?uuid=4ea6cc80-7874-4662-b496-7404b84576b8","name":""}]},"settings":"","auth":"required","params":[{"_id":"55abdf610685ce0d0049fbbf","ref":"","in":"body","required":false,"desc":"File containing documents, one document or URL per line","default":"","type":"file","name":"data"},{"_id":"55abdf610685ce0d0049fbbe","ref":"","in":"body","required":false,"desc":"Comma separated list of Text Analysis API endpoints, e.g. \"sentiment,entities\"","default":"","type":"string","name":"endpoints"},{"_id":"55abdf610685ce0d0049fbbd","ref":"","in":"body","required":false,"desc":"Type of documents in your file (`text` or `url`)","default":"","type":"string","name":"entities_type"},{"_id":"55abdf610685ce0d0049fbbc","ref":"","in":"body","required":false,"desc":"The format you wish to download the batch results in (`json` or `xml`)","default":"json","type":"string","name":"output_format"}],"url":"/batch"},"isReference":false,"order":0,"body":"Making API requests one by one can be inefficient and time consuming when you have a large number of documents to analyze. The **Batch Processing** endpoint provides a mechanism for analyzing documents in batch, which makes it easier to process a large number of documents at once.\n\nA successful batch job request will result in a `201 Created` HTTP status, with a Location header which indicates the URL you can poll to get the status of your submitted job. For convenience, the URL is also added to the body of the response.\n\nAfter receiving the status URL, you can retrieve the status of your batch job using the [Queue](doc:queue) endpoint.\n\nFor a step by step example of using the batch processing feature, please refer to [this short tutorial](http://blog.aylien.com/post/84415927163/batch-processing-documents-with-text-api).\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Processing time\",\n  \"body\": \"If your job is urgent we don't recommend using the batch processing endpoint. Due to the way our queuing system works, in busy periods you might see a delay of up to a few days before your job is processed. If you would like to execute multiple endpoints for a single document in one call, we recommend using our [Combined Calls](/docs/combined) endpoint instead.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Maximum file size\",\n  \"body\": \"Please note that the maximum file size supported by the Batch Processing endpoint is currently 5MB.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Quota calculation\",\n  \"body\": \"A set of N documents and M endpoints batched together counts toward your usage as N * M requests.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Premium feature\",\n  \"body\": \"Batch Processing is a premium feature, meaning it's only available to our paid users at the moment. If you would like to trial it please [drop us a line](mailto:support@aylien.com).\"\n}\n[/block]","excerpt":"/batch","slug":"batch","type":"post","title":"Submit Batch Job"}

postSubmit Batch Job

/batch

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

data:
file
File containing documents, one document or URL per line
endpoints:
string
Comma separated list of Text Analysis API endpoints, e.g. "sentiment,entities"
entities_type:
string
Type of documents in your file (`text` or `url`)
output_format:
stringjson
The format you wish to download the batch results in (`json` or `xml`)

Examples


Result Format


Documentation

Making API requests one by one can be inefficient and time consuming when you have a large number of documents to analyze. The **Batch Processing** endpoint provides a mechanism for analyzing documents in batch, which makes it easier to process a large number of documents at once. A successful batch job request will result in a `201 Created` HTTP status, with a Location header which indicates the URL you can poll to get the status of your submitted job. For convenience, the URL is also added to the body of the response. After receiving the status URL, you can retrieve the status of your batch job using the [Queue](doc:queue) endpoint. For a step by step example of using the batch processing feature, please refer to [this short tutorial](http://blog.aylien.com/post/84415927163/batch-processing-documents-with-text-api). [block:callout] { "type": "danger", "title": "Processing time", "body": "If your job is urgent we don't recommend using the batch processing endpoint. Due to the way our queuing system works, in busy periods you might see a delay of up to a few days before your job is processed. If you would like to execute multiple endpoints for a single document in one call, we recommend using our [Combined Calls](/docs/combined) endpoint instead." } [/block] [block:callout] { "type": "warning", "title": "Maximum file size", "body": "Please note that the maximum file size supported by the Batch Processing endpoint is currently 5MB." } [/block] [block:callout] { "type": "warning", "title": "Quota calculation", "body": "A set of N documents and M endpoints batched together counts toward your usage as N * M requests." } [/block] [block:callout] { "type": "info", "title": "Premium feature", "body": "Batch Processing is a premium feature, meaning it's only available to our paid users at the moment. If you would like to trial it please [drop us a line](mailto:support@aylien.com)." } [/block]

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}