{"openapi":"3.1.0","info":{"title":"Common Crawl News Index Gateway","description":"\nURL lookup tool for [Common Crawl News Dataset](https://data.commoncrawl.org/crawl-data/CC-NEWS/index.html) indexed in RocksDB with a simple API.\n\nCommand line client [`ccnget` on github](https://github.com/brian-learns/ccnget).\n\nBuilt from the [brian-learns/cdx-cc-news Dataset](https://huggingface.co/datasets/brian-learns/cdx-cc-news)\n\nFiles retrieved from Common Crawl are subject to [Common Crawl Terms of Use](https://commoncrawl.org/terms-of-use) and the original publisher's copyright.\n\nTHIS SOFTWARE IS PROVIDED BY \"AS IS\" AND ANY EXPRESS OR IMPLIED\nWARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\nOF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\nIN NO EVENT SHALL THE OPERATORS OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\nGOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\nINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\nIN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\nOTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\nIF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n","version":"0.1.2"},"paths":{"/lookup":{"get":{"summary":"Lookup Endpoint","description":"REST API endpoint supporting exact, partial prefix, or timestamp-targeted matching.","operationId":"lookup_endpoint_lookup_get","parameters":[{"name":"url","in":"query","required":true,"schema":{"type":"string","description":"URL to look for in the archive","title":"Url"},"description":"URL to look for in the archive"},{"name":"exact","in":"query","required":false,"schema":{"type":"boolean","description":"Exact matching vs prefix matching","default":false,"title":"Exact"},"description":"Exact matching vs prefix matching"},{"name":"at","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Timestamp (YYYYMMDDhhmmss). If exact=True, seeks from timestamp. If exact=False, finds closest match.","title":"At"},"description":"Timestamp (YYYYMMDDhhmmss). If exact=True, seeks from timestamp. If exact=False, finds closest match."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Maximum number of results to return","default":10,"title":"Limit"},"description":"Maximum number of results to return"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LookupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"CaptureResult":{"properties":{"surt_key":{"type":"string","title":"Surt Key","description":"SURT-formatted key prefix"},"timestamp":{"type":"string","title":"Timestamp","description":"Capture timestamp (YYYYMMDDhhmmss)"},"warc_path":{"type":"string","title":"Warc Path","description":"Path to the WARC file in Common Crawl"},"offset":{"type":"integer","title":"Offset","description":"Byte offset in the WARC file"},"length":{"type":"integer","title":"Length","description":"Record length in bytes"}},"type":"object","required":["surt_key","timestamp","warc_path","offset","length"],"title":"CaptureResult"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LookupResponse":{"properties":{"query_url":{"type":"string","title":"Query Url","description":"Original requested URL"},"surt_prefix":{"type":"string","title":"Surt Prefix","description":"SURT string used for lookup"},"exact_match":{"type":"boolean","title":"Exact Match","description":"Whether exact matching was used"},"at_timestamp":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"At Timestamp","description":"Timestamp parameter requested"},"total_results":{"type":"integer","title":"Total Results","description":"Number of results returned"},"limit":{"type":"integer","title":"Limit","description":"Maximum results cap requested"},"results":{"items":{"$ref":"#/components/schemas/CaptureResult"},"type":"array","title":"Results","description":"List of matched WARC captures"}},"type":"object","required":["query_url","surt_prefix","exact_match","total_results","limit","results"],"title":"LookupResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}