Back to Web Dev For Beginners

Adopt an API

5-browser-extension/2-forms-browsers-local-storage/assignment.md

latest4.7 KB
Original Source

Adopt an API

Overview

APIs open up endless possibilities for creative web development! In this assignment, you'll choose an external API and build a browser extension that solves a real problem or provides valuable functionality to users.

Instructions

Step 1: Choose Your API

Select an API from this curated list of free public APIs. Consider these categories:

Popular options for beginners:

Step 2: Plan Your Extension

Before coding, answer these planning questions:

  • What problem does your extension solve?
  • Who is your target user?
  • What data will you store in local storage?
  • How will you handle API failures or rate limits?

Step 3: Build Your Extension

Your extension should include:

Required Features:

  • Form inputs for any required API parameters
  • API integration with proper error handling
  • Local storage for user preferences or API keys
  • Clean, responsive user interface
  • Loading states and user feedback

Code Requirements:

  • Use modern JavaScript (ES6+) features
  • Implement async/await for API calls
  • Include proper error handling with try/catch blocks
  • Add meaningful comments explaining your code
  • Follow consistent code formatting

Step 4: Test and Polish

  • Test your extension with various inputs
  • Handle edge cases (no internet, invalid API responses)
  • Ensure your extension works after browser restart
  • Add user-friendly error messages

Bonus Challenges

Take your extension to the next level:

  • Add multiple API endpoints for richer functionality
  • Implement data caching to reduce API calls
  • Create keyboard shortcuts for common actions
  • Add data export/import features
  • Implement user customization options

Submission Requirements

  1. Working browser extension that successfully integrates with your chosen API
  2. README file explaining:
    • Which API you chose and why
    • How to install and use your extension
    • Any API keys or setup required
    • Screenshots of your extension in action
  3. Clean, commented code following modern JavaScript practices

Rubric

CriteriaExemplary (90-100%)Proficient (80-89%)Developing (70-79%)Beginning (60-69%)
API IntegrationFlawless API integration with comprehensive error handling and edge case managementSuccessful API integration with basic error handlingAPI works but has limited error handlingAPI integration has significant issues
Code QualityClean, well-commented modern JavaScript following best practicesGood code structure with adequate commentsCode works but needs better organizationPoor code quality with minimal comments
User ExperiencePolished interface with excellent loading states and user feedbackGood interface with basic user feedbackBasic interface that functions adequatelyPoor user experience with confusing interface
Local StorageSophisticated use of local storage with data validation and managementProper implementation of local storage for key featuresBasic local storage implementationMinimal or incorrect use of local storage
DocumentationComprehensive README with setup instructions and screenshotsGood documentation covering most requirementsBasic documentation missing some detailsPoor or missing documentation

Getting Started Tips

  1. Start simple: Choose an API that doesn't require complex authentication
  2. Read the docs: Thoroughly understand your chosen API's endpoints and responses
  3. Plan your UI: Sketch your extension's interface before coding
  4. Test frequently: Build incrementally and test each feature as you add it
  5. Handle errors: Always assume API calls might fail and plan accordingly

Resources

Have fun building something useful and creative! 🚀