{"agent":{"expose":"search","prompt":"Use Crawl4AI to get files of a GitHub repository."},"also":["read a file","source code","readme","file content"],"beta":true,"call":{"aliases":["POST /recipes/github-file"],"method":"POST","path":"/tools/github-file"},"categories":["dev-tools"],"cost":{"cases":[{"price":"","when":"1 to 2 credits, plus 0.5 per text file read in a folder"},{"price":"free","when":"A run with no row"}],"rule":"1 to 2 credits, plus 0.5 per text file read in a folder · a run with no row is free","text":"1 to 2 cr + 0.5 a file"},"description":"Files of a public GitHub repository, one row per file: one file, or every file under a folder (sub-folders included, in path order). A row holds the path, ref, blob sha, size in bytes, a language guessed from the extension, is_binary, the UTF-8 text cut at max_chars (null for a binary file) and the raw and GitHub URLs. url is a github.com /blob/ or /tree/ URL, a raw URL, or owner/name (the root folder); ref and path replace the URL's; max_files caps a folder. 2-4 units, plus 1 per text file of a folder.","docs":"/tools/github-file","essential":false,"essential_order":null,"examples":[{"answer":{"body":{"request_id":"req_…","rows":[{"content":"# 🚀🤖 Crawl4AI: the open-source web crawler for LLMs and AI agents\n\n<d…","is_binary":false,"is_truncated":false,"language":"Markdown","path":"README.md","raw_url":"https://raw.githubusercontent.com/unclecode/crawl4ai/main/README.md","ref":"main","repository":"unclecode/crawl4ai","sha":"0c340ab12975b9f1634b6da0f1857e1d42bdae41","size":26913,"url":"https://github.com/unclecode/crawl4ai/blob/main/README.md"}],"took_ms":731,"tool":"github-file","usage":{"credits":1}},"credits":1,"more":0,"rows":1,"took_ms":731},"input":{"max_chars":100000,"max_files":50,"path":"crawl4ai/__init__.py","ref":"main","url":"https://github.com/unclecode/crawl4ai/blob/main/README.md"},"label":"https://github.com/unclecode/crawl4ai/blob/main/"},{"input":{"path":"README.md","url":"unclecode/crawl4ai"},"label":"unclecode/crawl4ai, README.md"}],"id":"github-file","input_schema":{"additionalProperties":true,"properties":{"max_chars":{"default":100000,"description":"A file's text is cut at this many characters.","type":"integer"},"max_files":{"default":50,"description":"The most files read from a folder.","type":"integer"},"path":{"default":"","description":"A file or folder path in the repository; replaces the one in `url`.","type":"string"},"ref":{"default":"","description":"A branch, tag or commit; replaces the one in `url`. Empty = the URL's, else the default branch.","type":"string"},"url":{"description":"A github.com /blob/ or /tree/ URL, a raw URL, or owner/name (the repository's root folder).","type":"string"}},"required":["url"],"type":"object"},"inputs":[{"example":"https://github.com/unclecode/crawl4ai/blob/main/README.md","help":"A github.com /blob/ or /tree/ URL, a raw URL, or owner/name (the repository's root folder).","name":"url","required":true,"type":"string"},{"advanced":true,"default":"","example":"main","help":"A branch, tag or commit; replaces the one in `url`. Empty = the URL's, else the default branch.","name":"ref","type":"string"},{"advanced":true,"default":"","example":"crawl4ai/__init__.py","help":"A file or folder path in the repository; replaces the one in `url`.","name":"path","type":"string"},{"advanced":true,"default":50,"example":50,"help":"The most files read from a folder.","name":"max_files","type":"integer"},{"advanced":true,"default":100000,"example":100000,"help":"A file's text is cut at this many characters.","name":"max_chars","type":"integer"}],"kind":"sites","name":{"lead":"GitHub","rest":"files"},"output":{"fields":[{"meaning":"The repository as owner/name.","name":"repository","type":"string"},{"meaning":"The file's path from the repository root.","name":"path","type":"string"},{"meaning":"The branch, tag or commit the file was read at: the one asked for, else the repository's default branch.","name":"ref","type":"string"},{"meaning":"The file's git blob sha at the commit the ref pointed to when the row was read, the same commit as content; never computed from a cut text; null only when GitHub's API refused the one call that gives it.","name":"sha","type":"string"},{"meaning":"The file's full size in bytes, also when the text is cut.","name":"size","type":"integer"},{"meaning":"A language guessed from the file name or extension with a fixed table (Rust, Python, Markdown, ...); null when the table has no entry.","name":"language","type":"string"},{"meaning":"true when the file is not UTF-8 text (a NUL byte or invalid UTF-8 in what was read); in a folder a known binary extension (png, zip, pdf, fonts) counts and is not downloaded; null when the file could not be read.","name":"is_binary","type":"boolean"},{"meaning":"The file's text, cut at max_chars characters; null for a binary file or a file that could not be read.","name":"content","type":"string"},{"meaning":"true when content is shorter than the file (cut at max_chars, or a file over 8 MB).","name":"is_truncated","type":"boolean"},{"meaning":"The file on raw.githubusercontent.com at this ref.","name":"raw_url","type":"string"},{"meaning":"The file's page on github.com at this ref.","name":"url","type":"string"}],"row_is":"","view":"rows"},"related":[{"id":"github-issues","why":"Number, title, state, author, labels, comments, created, updated, body"},{"id":"github-repo","why":"Name, description, stars, forks, open issues, language, license"},{"id":"package-info","why":"Name, ecosystem, version, published, description, license, homepage"}],"run":"both","source":"github","status":"verified","summary":"Repository, path, size, language, content","synonyms":["file","files","github","repository","read a file","source code","readme","file content","code from a repository","raw file","repository files"],"typical":"7.3 s","version":2,"visibility":"public"}