DEV Community

Phil IPS
Phil IPS

Posted on

API Testing Tutorial: GitHub User Info

API Testing Tutorial: GitHub User Info

Learn to test APIs with real code examples.

Getting Started

We'll use GitHub's public API to fetch user information. No authentication required.

Code Example (curl)

curl -s "https://api.github.com/users/octocat" | jq .
Enter fullscreen mode Exit fullscreen mode

Response Analysis

The JSON response contains:

  • login: GitHub username
  • id: User ID
  • avatar_url: Profile picture URL
  • html_url: Profile link

Tips

  • Use -s for silent mode (no progress bar)
  • Pipe to jq for formatted JSON output
  • Replace "octocat" with any GitHub username

Conclusion

API testing is essential for developers. This simple example demonstrates real-world usage.

Top comments (0)