{"id":9775,"library":"gkeepapi","title":"gkeepapi Client for Google Keep","description":"An unofficial Python client for the Google Keep API. It enables programmatic interaction with notes, lists, and reminders, supporting CRUD operations. The library is currently at version 0.17.1 and receives maintenance releases as needed to adapt to API changes or address issues.","status":"active","version":"0.17.1","language":"en","source_language":"en","source_url":"https://github.com/kiwiz/gkeepapi","tags":["Google Keep","API client","notes","productivity","google"],"install":[{"cmd":"pip install gkeepapi","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Core HTTP client for API communication.","package":"requests","optional":false},{"reason":"Google's data interchange format used for API communication.","package":"protobuf","optional":false},{"reason":"Required for OAuth 2.0 authentication, an alternative to app passwords.","package":"google-auth","optional":true}],"imports":[{"symbol":"Keep","correct":"from gkeepapi import Keep"},{"note":"Node types like 'Note' and 'List' reside in the `gkeepapi.node` submodule, not directly under `gkeepapi`.","wrong":"from gkeepapi import Note","symbol":"Note","correct":"from gkeepapi.node import Note"},{"symbol":"InvalidUsernameOrPassword","correct":"from gkeepapi.exception import InvalidUsernameOrPassword"}],"quickstart":{"code":"import os\nfrom gkeepapi import Keep\nfrom gkeepapi.exception import InvalidUsernameOrPassword\n\n# Recommended: Use a Google App Password for programmatic access.\n# Generate one at: myaccount.google.com/apppasswords\n# Store in environment variables or directly replace placeholders.\nUSERNAME = os.environ.get('GKEEP_USERNAME', 'your_email@example.com')\nAPP_PASSWORD = os.environ.get('GKEEP_APP_PASSWORD', 'your_app_password')\n\nif not USERNAME or not APP_PASSWORD or APP_PASSWORD == 'your_app_password':\n    print(\"Please set GKEEP_USERNAME and GKEEP_APP_PASSWORD environment variables (or replace placeholders).\")\n    print(\"Consider using a Google App Password for better security.\")\n    exit(1)\n\nkeep = Keep()\n\ntry:\n    # Login using username and app password\n    success = keep.login(USERNAME, APP_PASSWORD)\n\n    if success:\n        print(\"Login successful!\")\n\n        # Create a new text note\n        note = keep.createNote('gkeepapi Quickstart Note', 'This note was created programmatically.')\n        print(f\"Created note: '{note.title}' (ID: {note.id})\")\n\n        # Sync changes to Google Keep\n        keep.sync()\n        print(\"Changes synced.\")\n\n        # Fetch and print titles of all notes\n        print(\"\\nAll notes in Keep:\")\n        for n in keep.all():\n            print(f\"- {n.title}\")\n\n    else:\n        print(\"Login failed for an unknown reason.\")\n\nexcept InvalidUsernameOrPassword:\n    print(\"Login failed: Invalid username or app password. Double-check your credentials and ensure an App Password is used.\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to log in to Google Keep using an app password, create a new note, sync changes, and retrieve all notes. Environment variables are used for credentials for security. Remember to replace placeholders or set actual environment variables."},"warnings":[{"fix":"Review the official GitHub README and documentation for your target version. Update `Keep.login()` calls and refactor code that directly accesses `gkeepapi.node` attributes or relies on old node type structures.","message":"Major API changes were introduced in versions 0.10.x, affecting authentication methods and the internal structure of node objects (`gkeepapi.node.*`). Code written for versions prior to 0.10.x will likely break.","severity":"breaking","affected_versions":"<0.10.0 to >=0.10.0"},{"fix":"Always use a generated Google App Password for programmatic access, or implement OAuth 2.0. App Passwords can be generated at `myaccount.google.com/apppasswords`.","message":"Directly using your primary Google account password for login is highly discouraged and often fails due to Google's security policies. This can result in 'InvalidUsernameOrPassword' errors or temporary account blocks.","severity":"gotcha","affected_versions":"All"},{"fix":"Implement delays between your API calls, especially for bulk operations. Consider using exponential backoff for retries to mitigate rate limiting.","message":"Aggressive or frequent API requests can lead to temporary IP bans or rate limiting by Google, resulting in HTTP 429 (Too Many Requests) errors.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Verify your Google username and App Password. Ensure you are using a generated App Password and not your main account password. If the issue persists, check your Google account's security settings for suspicious activity alerts.","cause":"Incorrect username/app password, or Google blocking login attempts due to security flags (e.g., using a primary password instead of an app password).","error":"gkeepapi.exception.InvalidUsernameOrPassword: 400 Client Error: Bad Request for url: ..."},{"fix":"Consult the current `gkeepapi` documentation or source code to understand the updated node object structure and available attributes/methods. Update your code to use the correct names and access patterns.","cause":"Attempting to access a node attribute or method that has been renamed or removed in newer `gkeepapi` versions (especially post-0.10.x refactor).","error":"AttributeError: 'Note' object has no attribute 'some_old_attribute'"},{"fix":"Reduce the frequency of your API calls. Add `time.sleep()` delays between requests, particularly in loops or batch operations. For robust applications, implement an exponential backoff strategy for retries.","cause":"The Google Keep API has temporarily rate-limited your IP address due to an excessive number of requests in a short period.","error":"requests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: ..."}]}