openapi: 3.0.3 info: title: 'MrScraper API Documentation' description: 'All the requests must be pointed to the following base URL:' version: 1.0.0 servers: - url: 'https://mrscraper.com' paths: /api/account: get: summary: 'Get an account information summary' operationId: getAnAccountInformationSummary description: 'This endpoint allows you to get basic information from your account such as token usage and other stats.' parameters: - in: header name: Authorization description: '' example: 'Bearer {YOUR_API_TOKEN}' schema: type: string - in: header name: Content-Type description: '' example: application/json schema: type: string - in: header name: Accept description: '' example: application/json schema: type: string responses: 200: description: '' content: application/json: schema: type: object example: data: subscription_plan: Ultimate token_usage: 137 token_limit: 30000 monthly_scrapes: 17 average_tokens_scrape: 8.06 properties: data: type: object properties: subscription_plan: type: string example: Ultimate token_usage: type: integer example: 137 token_limit: type: integer example: 30000 monthly_scrapes: type: integer example: 17 average_tokens_scrape: type: number example: 8.06 tags: - Account /api/scrapers: get: summary: 'List all scrapers' operationId: listAllScrapers description: 'This endpoint allows you to get a list of all your scrapers.' parameters: - in: header name: Authorization description: '' example: 'Bearer {YOUR_API_TOKEN}' schema: type: string - in: header name: Content-Type description: '' example: application/json schema: type: string - in: header name: Accept description: '' example: application/json schema: type: string responses: 200: description: '' content: text/plain: schema: type: string example: "{\n \"data\": [\n {\n \"id\": 88683,\n \"name\": \"My scraper 1\",\n \"url\": \"https://example.com/scrape-url\",\n \"scheduled\": false,\n \"schedule\": null,\n \"schedule_explanation\": null,\n \"created_at\": \"2022-11-20T11:54:52.000000Z\",\n \"updated_at\": \"2022-11-20T11:54:52.000000Z\"\n },\n {\n \"id\": 88684,\n \"name\": \"My scraper 2\",\n \"url\": \"https://example.com/scrape-url-alt\",\n \"scheduled\": true,\n \"schedule\": \"15 1 * * *\",\n \"schedule_explanation\": \"At 01:15 AM\",\n \"created_at\": \"2022-11-20T11:54:52.000000Z\",\n \"updated_at\": \"2022-11-20T11:54:52.000000Z\"\n },\n ]\n}" tags: - Scrapers '/api/scrapers/{scraper_id}': get: summary: 'Get a scraper' operationId: getAScraper description: "This endpoint allows you to get a single scraper's information." parameters: - in: header name: Authorization description: '' example: 'Bearer {YOUR_API_TOKEN}' schema: type: string - in: header name: Content-Type description: '' example: application/json schema: type: string - in: header name: Accept description: '' example: application/json schema: type: string responses: 200: description: '' content: application/json: schema: type: object example: data: id: 88683 name: 'My scraper 1' url: 'https://example.com/scrape-url' scheduled: true schedule: '15 1 * * *' schedule_explanation: 'At 01:15 AM' created_at: '2022-11-20T11:54:52.000000Z' updated_at: '2022-11-20T11:54:52.000000Z' properties: data: type: object properties: id: type: integer example: 88683 name: type: string example: 'My scraper 1' url: type: string example: 'https://example.com/scrape-url' scheduled: type: boolean example: true schedule: type: string example: '15 1 * * *' schedule_explanation: type: string example: 'At 01:15 AM' created_at: type: string example: '2022-11-20T11:54:52.000000Z' updated_at: type: string example: '2022-11-20T11:54:52.000000Z' tags: - Scrapers parameters: - in: path name: scraper_id description: "The scraper's ID." example: 88683 required: true schema: type: integer '/api/scrapers/{scraper_id}/run': post: summary: 'Run a scraper' operationId: runAScraper description: 'This endpoint allows you to tell a scraper to start scraping.' parameters: - in: header name: Authorization description: '' example: 'Bearer {YOUR_API_TOKEN}' schema: type: string - in: header name: Content-Type description: '' example: application/json schema: type: string - in: header name: Accept description: '' example: application/json schema: type: string responses: 200: description: '' content: application/json: schema: type: object example: data: - id: 1 scraper_id: 88683 scraper_name: 'My scraper 1' scraped_url: 'https://example.com/page-1' status: queued content: null created_at: '2022-11-20T11:54:52.000000Z' updated_at: '2022-11-20T11:54:52.000000Z' - id: 2 scraper_id: 88683 scraper_name: 'My scraper 1' scraped_url: 'https://example.com/page-2' status: queued content: null created_at: '2022-10-20T11:54:52.000000Z' updated_at: '2022-10-20T11:54:52.000000Z' properties: data: type: array example: - id: 1 scraper_id: 88683 scraper_name: 'My scraper 1' scraped_url: 'https://example.com/page-1' status: queued content: null created_at: '2022-11-20T11:54:52.000000Z' updated_at: '2022-11-20T11:54:52.000000Z' - id: 2 scraper_id: 88683 scraper_name: 'My scraper 1' scraped_url: 'https://example.com/page-2' status: queued content: null created_at: '2022-10-20T11:54:52.000000Z' updated_at: '2022-10-20T11:54:52.000000Z' items: type: object properties: id: type: integer example: 1 scraper_id: type: integer example: 88683 scraper_name: type: string example: 'My scraper 1' scraped_url: type: string example: 'https://example.com/page-1' status: type: string example: queued content: type: string example: null created_at: type: string example: '2022-11-20T11:54:52.000000Z' updated_at: type: string example: '2022-11-20T11:54:52.000000Z' tags: - Scrapers requestBody: required: false content: application/json: schema: type: object properties: urls: type: array description: 'The URLs to scrape if you want to override default ones.' example: - 'https://example.com/page-1' - 'https://example.com/page-2' items: type: string parameters: - in: path name: scraper_id description: "The scraper's ID." example: 88683 required: true schema: type: integer '/api/scrapers/{scraper_id}/results/latest': get: summary: "Get a scraper's latest result" operationId: getAScrapersLatestResult description: "This endpoint returns the information about the latest result for a scraper.\n\nYou can use the optional `status` body parameter to filter the result for a particular scraping status." parameters: - in: header name: Authorization description: '' example: 'Bearer {YOUR_API_TOKEN}' schema: type: string - in: header name: Content-Type description: '' example: application/json schema: type: string - in: header name: Accept description: '' example: application/json schema: type: string responses: 200: description: '' content: application/json: schema: type: object example: data: null properties: data: type: string example: null tags: - Results requestBody: required: false content: application/json: schema: type: object properties: status: type: string description: 'Must be one of (queued, running, failed, succeeded).' example: succeeded parameters: - in: path name: scraper_id description: "The scraper's ID." example: 88683 required: true schema: type: integer /api/results: get: summary: 'List all results' operationId: listAllResults description: 'This endpoint allows you to get a list of all your scraping results.' parameters: - in: header name: Authorization description: '' example: 'Bearer {YOUR_API_TOKEN}' schema: type: string - in: header name: Content-Type description: '' example: application/json schema: type: string - in: header name: Accept description: '' example: application/json schema: type: string responses: 200: description: '' content: application/json: schema: type: object example: data: - id: 2 scraper_id: 88683 scraper_name: 'My scraper 1' scraped_url: 'https://example.com/scrape-url' status: succeeded content: '' created_at: '2022-11-20T11:54:52.000000Z' updated_at: '2022-11-20T11:54:52.000000Z' - id: 1 scraper_id: 88683 scraper_name: 'My scraper 1' scraped_url: 'https://example.com/scrape-url' status: succeeded content: '' created_at: '2022-10-20T11:54:52.000000Z' updated_at: '2022-10-20T11:54:52.000000Z' properties: data: type: array example: - id: 2 scraper_id: 88683 scraper_name: 'My scraper 1' scraped_url: 'https://example.com/scrape-url' status: succeeded content: '' created_at: '2022-11-20T11:54:52.000000Z' updated_at: '2022-11-20T11:54:52.000000Z' - id: 1 scraper_id: 88683 scraper_name: 'My scraper 1' scraped_url: 'https://example.com/scrape-url' status: succeeded content: '' created_at: '2022-10-20T11:54:52.000000Z' updated_at: '2022-10-20T11:54:52.000000Z' items: type: object properties: id: type: integer example: 2 scraper_id: type: integer example: 88683 scraper_name: type: string example: 'My scraper 1' scraped_url: type: string example: 'https://example.com/scrape-url' status: type: string example: succeeded content: type: string example: '' created_at: type: string example: '2022-11-20T11:54:52.000000Z' updated_at: type: string example: '2022-11-20T11:54:52.000000Z' tags: - Results '/api/results/{result_id}': get: summary: 'Get a result' operationId: getAResult description: 'This endpoint allows you to get a scraping result.' parameters: - in: header name: Authorization description: '' example: 'Bearer {YOUR_API_TOKEN}' schema: type: string - in: header name: Content-Type description: '' example: application/json schema: type: string - in: header name: Accept description: '' example: application/json schema: type: string responses: 200: description: '' content: text/plain: schema: type: string example: "{\n \"id\": 1,\n \"scraper_id\": 88683,\n \"scraper_name\": \"My scraper 1\",\n \"scraped_url\": \"https://example.com/scrape-url\",\n \"status\": \"succeeded\",\n \"content\": \"\",\n \"created_at\": \"2022-11-20T11:54:52.000000Z\",\n \"updated_at\": \"2022-11-20T11:54:52.000000Z\"\n}," tags: - Results delete: summary: 'Delete a result' operationId: deleteAResult description: 'This endpoint allows you to delete a scraping result.' parameters: - in: header name: Authorization description: '' example: 'Bearer {YOUR_API_TOKEN}' schema: type: string - in: header name: Content-Type description: '' example: application/json schema: type: string - in: header name: Accept description: '' example: application/json schema: type: string responses: 200: description: '' content: application/json: schema: type: object example: { } properties: { } tags: - Results parameters: - in: path name: result_id description: "The result's ID." example: 88683 required: true schema: type: integer tags: - name: Account description: '' - name: Scrapers description: '' - name: Results description: '' components: securitySchemes: default: type: http scheme: bearer description: '' security: - default: []