{"__v":12,"_id":"543f5d87baae8a08005f62b3","category":{"__v":0,"_id":"5446f625beb6320800da6eef","pages":["54343293fa5527080064f478","543f5d87baae8a08005f62b3"],"project":"54343293fa5527080064f472","version":"54343293fa5527080064f475","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-22T00:11:17.687Z","from_sync":false,"order":1,"slug":"articles","title":"Articles"},"is_link":false,"project":"54343293fa5527080064f472","user":"5434326ae532ff0800e185ab","version":{"__v":4,"_id":"54343293fa5527080064f475","project":"54343293fa5527080064f472","createdAt":"2014-10-07T18:36:03.237Z","releaseDate":"2014-10-07T18:36:03.237Z","categories":["54343293fa5527080064f476","543f5d6114785f080042d29d","543f5fc9d09132080000b857","5446f625beb6320800da6eef"],"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":"2014-10-16T05:54:15.633Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"basic_auth":false,"results":{"codes":[]},"try":true,"auth":"never","params":[],"url":""},"isReference":false,"order":1,"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"The Bulk API is in Beta and should be considered experimental.\"\n}\n[/block]\nUsers on paid plans have access to a bulk querying endpoint, where you can POST a large batch of URLs all at once, and poll for the result once its ready. Responses will be in JSON. This endpoint will not be available in JSONP. \n\nURLs are transmitted one per line in the POST body, with a trailing line-break after the final URL.\n\nFor example, you would query:\n```\nPOST https://[[app:plan]].sharedcount.com/bulk?apikey=[[app:key]]\n\nRequest Body:\nhttp://www.google.com/\nhttp://www.amazon.com/\n\n```\n\n##Batch Sizes\nThe maximum number of URLs you can query in a batch depends on your plan:\n\n- Plus: 500\n- Business: 1,000\n- Dedicated: 10,000\n\nSuccessfully completed API queries done via batching will count against your daily API quota. Requests exceeding your API quota will be rejected. Under the covers, the bulk endpoint acts as a layer on top of the existing API; one which handles the queueing and processing of a large number of queries for the purposes of reducing transit overhead. \n\nWhen you make your POST request, you'll receive a response giving you a bulk_id, and also the number of URLs that were accepted and queued for querying. Invalid URLs will be silently ignored.\n\nThe bulk_id can be used to fetch the completed response:\n```\nGET [[app:plan]].sharedcount.com/bulk?apikey=[[app:key]]&bulk_id=:bulk_id\n```\nWhen you make this request, you'll get back an object indicating the number of URLs completed thus far. If all of the queued URLs are complete, the full data will be returned. When this `complete` state is reached and your full data is returned, further requests for that bulk_id may no longer return data.\n\nIf you want to receive your data incrementally while it's being churned, you can add a `&force=1` parameter to the URL, and each request will contain the completed URL data up until that point: \n```\nGET [[app:plan]].sharedcount.com/bulk?apikey=[[app:key]]&bulk_id=:bulk_id&force=1\n```\nThis can be useful if for some reason one or two URLs remain outstanding for an extended period of time.","excerpt":"","slug":"bulk-api","type":"basic","title":"Bulk API"}
[block:callout] { "type": "warning", "title": "The Bulk API is in Beta and should be considered experimental." } [/block] Users on paid plans have access to a bulk querying endpoint, where you can POST a large batch of URLs all at once, and poll for the result once its ready. Responses will be in JSON. This endpoint will not be available in JSONP. URLs are transmitted one per line in the POST body, with a trailing line-break after the final URL. For example, you would query: ``` POST https://[[app:plan]].sharedcount.com/bulk?apikey=[[app:key]] Request Body: http://www.google.com/ http://www.amazon.com/ ``` ##Batch Sizes The maximum number of URLs you can query in a batch depends on your plan: - Plus: 500 - Business: 1,000 - Dedicated: 10,000 Successfully completed API queries done via batching will count against your daily API quota. Requests exceeding your API quota will be rejected. Under the covers, the bulk endpoint acts as a layer on top of the existing API; one which handles the queueing and processing of a large number of queries for the purposes of reducing transit overhead. When you make your POST request, you'll receive a response giving you a bulk_id, and also the number of URLs that were accepted and queued for querying. Invalid URLs will be silently ignored. The bulk_id can be used to fetch the completed response: ``` GET [[app:plan]].sharedcount.com/bulk?apikey=[[app:key]]&bulk_id=:bulk_id ``` When you make this request, you'll get back an object indicating the number of URLs completed thus far. If all of the queued URLs are complete, the full data will be returned. When this `complete` state is reached and your full data is returned, further requests for that bulk_id may no longer return data. If you want to receive your data incrementally while it's being churned, you can add a `&force=1` parameter to the URL, and each request will contain the completed URL data up until that point: ``` GET [[app:plan]].sharedcount.com/bulk?apikey=[[app:key]]&bulk_id=:bulk_id&force=1 ``` This can be useful if for some reason one or two URLs remain outstanding for an extended period of time.