{"openapi":"3.1.0","info":{"title":"Reworkd Scraping API","description":"API for interacting with your Web Data","contact":{"name":"Reworkd","url":"https://reworkd.ai/","email":"founders@reworkd.ai"},"version":"0.1.0"},"servers":[{"url":"https://api.reworkd.dev"}],"paths":{"/v1/outputs/{group_id}":{"get":{"tags":["Public"],"summary":"Get outputs for a scraping group","description":"Allows you to fetch all outputs for a given scraping group. The results are a\nmaterialized view of the outputs for the group; meaning the results are\ndeduplicated. This view is updated depending on how often the group is scheduled\nto be re-scraped.\n\nThe results are paginated and sorted by the `create_date` of items in ascending order.\nYou can fetch the next page by using the `next_url` or `next_cursor` fields in the\nresponse metadata.\n\nTypically, you'd also want to provide a `created_after` filter to only fetch outputs\ncreated after a certain date. This is useful when you want to fetch new outputs\nsince the last time you fetched outputs; thus allowing you to maintain a \"real-time\"\nview of the outputs.","operationId":"get_output_v1_outputs__group_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"string","description":"ID of the scraping group you want to fetch outputs for. This can be found on the groups page in the individual group card.","title":"Group Id"},"description":"ID of the scraping group you want to fetch outputs for. This can be found on the groups page in the individual group card."},{"name":"job_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ID of the root scraping job to filter outputs by. Useful when you need to fetch results from a specific domain or data source within a group. When omitted, outputs from all jobs in the group will be returned.","examples":["03583f9c-6c90-4f3c-9afd-186258d6f4d6",null],"title":"Job Id"},"description":"ID of the root scraping job to filter outputs by. Useful when you need to fetch results from a specific domain or data source within a group. When omitted, outputs from all jobs in the group will be returned."},{"name":"created_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter outputs to only include those created or updated on or after this timestamp. Accepts ISO 8601 format (YYYY-MM-DD or YYYY-MM-DDTHH:MM:SSZ). Essential for incremental data syncing to avoid fetching the entire dataset on each request.","examples":["2025-01-15T10:00:00Z","2025-01-15",null],"title":"Created After"},"description":"Filter outputs to only include those created or updated on or after this timestamp. Accepts ISO 8601 format (YYYY-MM-DD or YYYY-MM-DDTHH:MM:SSZ). Essential for incremental data syncing to avoid fetching the entire dataset on each request."},{"name":"url","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Complete URL to fetch outputs for, including protocol and path. Must match exactly the URL that was processed by the scraper.","examples":["https://www.example.com/product/product_id_123"],"title":"Url"},"description":"Complete URL to fetch outputs for, including protocol and path. Must match exactly the URL that was processed by the scraper."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"description":"Number of results to return per page","default":10,"title":"Limit"},"description":"Number of results to return per page"},{"name":"cursor","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Cursor to paginate through results","default":0,"title":"Cursor"},"description":"Cursor to paginate through results"},{"name":"country","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Name of the country to filter by (eg: United States)","examples":["United States"],"title":"Country"},"description":"Name of the country to filter by (eg: United States)"},{"name":"region","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO 3166-2 code of the region to filter by (eg: US-CA)","examples":["US-CA","US-TX"],"title":"Region"},"description":"ISO 3166-2 code of the region to filter by (eg: US-CA)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Paginated_Output_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/cookies":{"get":{"tags":["Public"],"summary":"Get Cookies","operationId":"get_cookies_v1_cookies_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"domain","in":"query","required":true,"schema":{"type":"string","title":"Domain"},"example":"example.com"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CookieModel"},"title":"Response Get Cookies V1 Cookies Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Public"],"summary":"Set Cookies","operationId":"set_cookies_v1_cookies_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"scraping_group_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scraping Group Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CookieUpsert"},"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/local-storage":{"get":{"tags":["Public"],"summary":"Get Local Storage","operationId":"get_local_storage_v1_local_storage_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"domain","in":"query","required":true,"schema":{"type":"string","title":"Domain"},"example":"example.com"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LocalStorage"},"title":"Response Get Local Storage V1 Local Storage Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Public"],"summary":"Set Local Storage","operationId":"set_local_storage_v1_local_storage_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"scraping_group_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scraping Group Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LocalStorageUpsert"},"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/reviews/{group_id}":{"get":{"tags":["Public"],"summary":"Get Latest Reviews","description":"Get the latest review status and comment for a group.","operationId":"get_latest_reviews_v1_reviews__group_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"group_id","in":"path","required":true,"schema":{"type":"string","description":"ID of the scraping group you want to fetch reviews for. This can be found on the groups page in the individual group card.","title":"Group Id"},"description":"ID of the scraping group you want to fetch reviews for. This can be found on the groups page in the individual group card."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewOutputs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ChangesetAction":{"type":"string","enum":["CREATE","UPDATE","DELETE","NOOP"],"title":"ChangesetAction","description":"Denotes which type of change was made to a resource.\nIf an output row has never been seen before, it is considered a `CREATE`.\nIf an output row has been seen before, but has changed, it is considered an `UPDATE`.\nIf an output row has been seen before, but is no longer present, it is considered a `DELETE`.\nIf an output row has been seen before, and has not changed, it is considered a `NOOP`."},"CookieModel":{"properties":{"name":{"type":"string","title":"Name"},"value":{"type":"string","title":"Value"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Path"},"expires":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Expires"},"http_only":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Http Only","default":false},"secure":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Secure","default":false}},"type":"object","required":["name","value"],"title":"CookieModel"},"CookieUpsert":{"properties":{"domain":{"type":"string","title":"Domain"},"path":{"type":"string","title":"Path","default":""},"name":{"type":"string","title":"Name"},"value":{"type":"string","title":"Value"},"secure":{"type":"boolean","title":"Secure"},"http_only":{"type":"boolean","title":"Http Only"},"expires":{"type":"string","format":"date-time","title":"Expires"}},"type":"object","required":["domain","name","value","secure","http_only","expires"],"title":"CookieUpsert"},"Download":{"properties":{"id":{"type":"string","title":"Id"},"field":{"type":"string","title":"Field"},"url_etag_hash":{"type":"string","title":"Url Etag Hash"},"s3_key":{"type":"string","title":"S3 Key"},"s3_url":{"type":"string","title":"S3 Url","description":"A pre-signed URL to download the file"},"source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Url"},"create_date":{"type":"string","title":"Create Date"},"file_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Url"},"file_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Type"},"file_checksum":{"type":"string","title":"File Checksum"},"file_metadata":{"additionalProperties":{"type":"string"},"type":"object","title":"File Metadata"}},"type":"object","required":["id","field","url_etag_hash","s3_key","s3_url","source_url","create_date","file_url","file_type","file_checksum","file_metadata"],"title":"Download"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LocalStorage":{"properties":{"id":{"type":"integer","title":"Id"},"organization_id":{"type":"integer","title":"Organization Id"},"group_id":{"type":"integer","minimum":0.0,"title":"Group Id","default":0},"domain":{"type":"string","title":"Domain"},"path":{"type":"string","title":"Path","default":"/"},"key":{"type":"string","title":"Key"},"value":{"type":"string","title":"Value"},"expires":{"type":"string","format":"date-time","title":"Expires"},"create_date":{"type":"string","format":"date-time","title":"Create Date"},"update_date":{"type":"string","format":"date-time","title":"Update Date"}},"type":"object","required":["organization_id","domain","key","value","expires"],"title":"LocalStorage"},"LocalStorageUpsert":{"properties":{"domain":{"type":"string","title":"Domain"},"path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Path","default":"/"},"key":{"type":"string","title":"Key"},"value":{"type":"string","title":"Value"},"expires":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires"}},"type":"object","required":["domain","key","value"],"title":"LocalStorageUpsert"},"Output":{"properties":{"source_url":{"type":"string","title":"Source Url","examples":["http://example.com"]},"data":{"type":"object","title":"Data","description":"The extracted data normalized to the schema of the scraping group","examples":[{"age":30,"email":"john@example.com","images":["http://example.com/profile.jpg","http://example.com/photo.jpg"],"name":"John Doe"}]},"id":{"type":"integer","title":"Id","deprecated":true},"output_id":{"type":"string","title":"Output Id","examples":["206fdc72-10c0-468c-996f-ff3f8cc51592"]},"root_job_id":{"type":"string","title":"Root Job Id","description":"The ID of the root job that this output was created from","examples":["497dcba3-ecbf-4587-a2dd-5eb0665e6880"]},"create_date":{"type":"string","title":"Create Date","description":"The date when this output was first created in the system","examples":["2023-02-14T00:00:00"]},"update_date":{"type":"string","title":"Update Date","description":"The date when the output data was last modified","examples":["2023-02-14T16:00:00"]},"last_scraped_date":{"type":"string","title":"Last Scraped Date","description":"The date when this output was most recently scraped, even if no changes were detected","examples":["2023-02-14T16:00:00"]},"change_type":{"$ref":"#/components/schemas/ChangesetAction","examples":["CREATE"]},"key_hash":{"type":"string","title":"Key Hash","examples":["d41d8cd98f00b204e9800998ecf8427e"]},"value_hash":{"type":"string","title":"Value Hash","examples":["d41d8cd98f00b204e9800998ecf8427e"]},"is_approved":{"type":"boolean","title":"Is Approved","description":"A boolean describing whether or not the job this output was created from has been marked as `APPROVED`","examples":[true]},"tags":{"additionalProperties":{"type":"string"},"type":"object","title":"Tags","description":"Custom user-defined metadata associated with the source job the output was produced from. Country and region information is automatically added to the tags.","examples":[{"country":"US","external_customer_id":"12345","region":"US-CA"}]},"files":{"items":{"$ref":"#/components/schemas/Download"},"type":"array","title":"Files","description":"The files that were extracted by the scraper","examples":[[{"create_date":"2023-02-14T00:00:00","field":"image[0]","file_checksum":"d41d8cd98f00b204e9800998ecf8427e","file_metadata":{},"file_type":"jpg","file_url":"http://example.com/example.jpg","id":"206fdc72-10c0-468c-996f-ff3f8cc51592","s3_key":"example.jpg","s3_url":"https://files.reworkd.dev/d41d8cd98f00b204e9800998ecf8427e.jpg","source_url":"http://example.com","url_etag_hash":"d41d8cd98f00b204e9800998ecf8427e"}]]}},"type":"object","required":["source_url","data","id","output_id","root_job_id","create_date","update_date","last_scraped_date","change_type","key_hash","value_hash","is_approved","tags","files"],"title":"Output","description":"Represents a single output from a scraping job. This is the data that was extracted\nfrom a website by a scraper. The `data` field contains the extracted data normalized\nto the schema of the scraping group.\n\nThe `files` field contains the files that were extracted by the scraper. The files\ncan be downloaded from the `s3_url` field.\n\nThe change type indicate if it was the first time the output was created or if it was\nan update or delete of an existing record. See `ChangesetAction` for more details."},"PaginatedMetadata":{"properties":{"next_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Url","description":"URL to the next page. Null if no next page.","examples":["https://api.reworkd.dev/v1/items?cursor=2612294"]},"next_cursor":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Cursor","description":"Cursor to the next page. Null if no next page.","examples":[2612294]}},"type":"object","required":["next_url","next_cursor"],"title":"PaginatedMetadata"},"Paginated_Output_":{"properties":{"metadata":{"$ref":"#/components/schemas/PaginatedMetadata"},"items":{"items":{"$ref":"#/components/schemas/Output"},"type":"array","title":"Items"}},"type":"object","required":["metadata","items"],"title":"Paginated[Output]"},"ReviewOutput":{"properties":{"job_id":{"type":"string","title":"Job Id"},"review_id":{"type":"string","title":"Review Id"},"review_date":{"type":"string","title":"Review Date"},"status":{"type":"string","title":"Status"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment"}},"type":"object","required":["job_id","review_id","review_date","status"],"title":"ReviewOutput"},"ReviewOutputs":{"items":{"$ref":"#/components/schemas/ReviewOutput"},"type":"array","title":"ReviewOutputs"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}