<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: zhaochangbo888</title>
    <description>The latest articles on DEV Community by zhaochangbo888 (@zhaochangbo888).</description>
    <link>https://dev.to/zhaochangbo888</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4046410%2Ffd7cc2c5-006c-4135-af36-7de6ff2e7d25.jpg</url>
      <title>DEV Community: zhaochangbo888</title>
      <link>https://dev.to/zhaochangbo888</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zhaochangbo888"/>
    <language>en</language>
    <item>
      <title>I Built an API That Writes Code Documentation in 13 Languages — Here's How</title>
      <dc:creator>zhaochangbo888</dc:creator>
      <pubDate>Sat, 25 Jul 2026 06:05:55 +0000</pubDate>
      <link>https://dev.to/zhaochangbo888/i-built-an-api-that-writes-code-documentation-in-13-languages-heres-how-46e2</link>
      <guid>https://dev.to/zhaochangbo888/i-built-an-api-that-writes-code-documentation-in-13-languages-heres-how-46e2</guid>
      <description>&lt;p&gt;I’ve always disliked writing documentation. Not because it’s hard, but because it’s repetitive. You write a function, you describe what it does, you give an example, and then you realize you need the same thing in another language because half your users don’t speak English.&lt;/p&gt;

&lt;p&gt;So I decided to automate it.&lt;/p&gt;

&lt;p&gt;The result is an API that takes source code as input and returns a clean Markdown README, API reference, or inline comments — in any of 13 languages. No templates, no manual translation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST &lt;span class="s2"&gt;"https://ai-code-documentation-generator.p.rapidapi.com/demo"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"x-rapidapi-host: ai-code-documentation-generator.p.rapidapi.com"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"x-rapidapi-key: YOUR_KEY"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"code":"def add(a,b): return a+b","code_language":"python","doc_language":"en"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"success"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"documentation"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"# Add Utility&lt;/span&gt;&lt;span class="se"&gt;\n\n&lt;/span&gt;&lt;span class="s2"&gt;## Overview&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;A simple function to add two numbers..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"quality_score"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"target_language"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"en"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It auto-detects the programming language (Python, JavaScript, Go, Rust…) and spits out a polished doc. The English output is solid, but seeing it generate accurate Japanese or German READMEs from the same code still feels like magic.&lt;/p&gt;

&lt;p&gt;The Tech Behind It&lt;br&gt;
Backend: Python + FastAPI, hosted on Northflank.&lt;/p&gt;

&lt;p&gt;AI Model: DeepSeek (via API). The model actually understands code structure, so generated docs aren’t just generic wrappers.&lt;/p&gt;

&lt;p&gt;Language Detection: Pygments for syntax highlighting + language guessing.&lt;/p&gt;

&lt;p&gt;Caching: 24-hour cache to avoid redundant calls and save cost.&lt;/p&gt;

&lt;p&gt;Security: Sensitive strings (API keys, passwords) are automatically redacted from the output.&lt;/p&gt;

&lt;p&gt;The whole thing is open source:&lt;br&gt;
&lt;a href="https://github.com/zhaochangbo888/docgen-api" rel="noopener noreferrer"&gt;https://github.com/zhaochangbo888/docgen-api&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Why I Didn’t Just Use ChatGPT&lt;br&gt;
You could absolutely paste your code into ChatGPT and ask for docs. But integrating an LLM directly into a CI/CD pipeline, or a VS Code extension, or a platform that needs programmatic access gets messy with rate limits, authentication, and output consistency.&lt;/p&gt;

&lt;p&gt;This API gives you a predictable JSON schema, reliable caching, and optional overrides for detail level and format. It’s designed to be called by other tools, not just by humans.&lt;/p&gt;

&lt;p&gt;What It Cost Me to Run&lt;br&gt;
DeepSeek’s pricing is absurdly cheap. A 2,000-word README costs less than $0.001. Even with the free tier (50 req/month), I’m not worried about losing money while people test it.&lt;/p&gt;

&lt;p&gt;Try It Yourself&lt;br&gt;
There’s a demo endpoint with no subscription required (5 requests/day). Just grab a free RapidAPI key and start playing:&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://rapidapi.com/zhaochangbo0/api/ai-code-documentation-generator" rel="noopener noreferrer"&gt;https://rapidapi.com/zhaochangbo0/api/ai-code-documentation-generator&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Plans:&lt;/p&gt;

&lt;p&gt;Free: 50 requests/month&lt;/p&gt;

&lt;p&gt;Basic: $9.99/month for 5,000 requests&lt;/p&gt;

&lt;p&gt;Pro: $49/month for 50,000 requests&lt;/p&gt;

&lt;p&gt;All plans include all 13 languages and all doc formats (readme, api_doc, inline comments).&lt;/p&gt;

&lt;p&gt;What I’d Love Feedback On&lt;br&gt;
I’m actively improving the output quality. If you try it on your own code, let me know:&lt;/p&gt;

&lt;p&gt;Does the generated doc actually save you time?&lt;/p&gt;

&lt;p&gt;What languages or doc formats are missing?&lt;/p&gt;

&lt;p&gt;Does the quality hold up for larger, real-world codebases?&lt;/p&gt;

&lt;p&gt;Drop a comment or open an issue on GitHub. I’ll be hanging out in the replies.&lt;/p&gt;

</description>
      <category>api</category>
      <category>documentation</category>
      <category>python</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
