DEV Community

Cover image for β™ŸοΈ I built a Free API for Go (Baduk) Problems with 49k+ puzzles
Apisit Thananchai
Apisit Thananchai

Posted on

β™ŸοΈ I built a Free API for Go (Baduk) Problems with 49k+ puzzles

Hello Dev Community! πŸ‘‹

I'm a developer who loves the board game Go (also known as Baduk or Weiqi). Recently, I wanted to build a simple app to practice "Tsumego" (Life & Death problems), but I realized there wasn't an easy-to-use API that provided a large dataset of problems for developers.

Most resources were either locked behind legacy websites or required complex parsing. So, I decided to build my own and open it up for everyone! πŸš€

πŸ’‘ What is Go Problem API?

It is a free RESTful API that serves over 49,500+ Go problems. It's designed for developers who want to build:

  • Go training apps
  • Daily puzzle widgets
  • Bots or AI training sets

πŸ› οΈ The Tech Stack

For those interested in how it was built, I used:

  • Backend: Node.js with Express
  • Database: PostgreSQL (hosted on Neon)
  • API Gateway: RapidAPI (for management and analytics)

I optimized the queries to ensure the latency remains low (usually under 20ms).

πŸš€ How to use it

It's hosted on RapidAPI. You can fetch a random problem easily. Here is a quick example using JavaScript (Fetch):

const url = '[https://go-problem-api.p.rapidapi.com/random](https://go-problem-api.p.rapidapi.com/random)';
const options = {
    method: 'GET',
    headers: {
        'x-rapidapi-key': 'YOUR_API_KEY_HERE',
        'x-rapidapi-host': 'go-problem-api.p.rapidapi.com'
    }
};

try {
    const response = await fetch(url, options);
    const result = await response.json();
    console.log(result);
} catch (error) {
    console.error(error);
}
Enter fullscreen mode Exit fullscreen mode

πŸ”— Try it out

You can test the endpoints, see the response format, and get your free API key directly on RapidAPI:
πŸ‘‰ Get started with Go Problem API

πŸ’­ Feedback?

This is a side project I built to help the Go/Baduk community. I'm actively working to improve it, so your feedback is incredibly valuable.

  • Does the JSON structure make sense?
  • Are there specific features you'd like to see?
  • Did you run into any issues?

Please let me know in the comments below! If you build something cool with it, drop a linkβ€”I’d love to see it.

Happy Coding! πŸ‘¨β€πŸ’»

Top comments (0)