Getting started overview

Integrating Passwordinator into an application involves a sequence of steps, beginning with account creation and API key retrieval, followed by making a successful initial API request. This guide focuses on the essential actions required to generate a strong password using the Password Generation API endpoint. The process is designed to be streamlined, allowing developers to quickly implement core functionality.

Passwordinator offers a Developer Plan free tier providing 5,000 requests per month, which is suitable for initial development and testing. Paid plans, such as the Basic Plan, commence at $9 per month for increased request volumes.

Quick Reference: Getting Started with Passwordinator

Step What to do Where to go
1. Sign Up Create a Passwordinator account. Passwordinator Signup Page
2. Get API Keys Locate and copy your API key from the dashboard. Passwordinator Dashboard
3. Install SDK (Optional) Install the relevant SDK for your programming language (e.g., Python, Node.js). Passwordinator SDK Documentation
4. Make First Request Write code to send a request to the Password Generation API. Password Generation API Reference
5. Handle Response Process the API response to retrieve the generated password. Your application code

Create an account and get keys

Access to Passwordinator's API requires an account and a valid API key. Follow these steps to set up your environment:

  1. Sign Up for an Account: Navigate to the Passwordinator signup page. Provide the required information to create a new account. Upon successful registration, you will typically be redirected to your developer dashboard.
  2. Locate Your API Key: Once logged in, your developer dashboard will display your unique API key. This key is essential for authenticating your API requests. It is recommended to store this key securely, for example, using environment variables, rather than hardcoding it directly into your application code. For best practices on securing API keys, consult resources like Google Cloud's API key security documentation.
  3. Understand API Key Usage: The API key is typically sent in the Authorization header of your HTTP requests, often prefixed with Bearer, or as a query parameter, depending on the specific API endpoint's requirements. Refer to the Passwordinator authentication documentation for exact implementation details.

Your first request

This section demonstrates how to make a basic request to the Passwordinator API to generate a strong password. We will provide examples using cURL for direct HTTP requests and Python and Node.js for SDK-based integrations.

Using cURL (Direct HTTP Request)

To generate a password with default parameters (e.g., length, character sets), use a GET request to the /generate endpoint. Replace YOUR_API_KEY with your actual API key.

curl -X GET \
  'https://api.passwordinator.com/generate' \
  -H 'Authorization: Bearer YOUR_API_KEY'

A successful response will return a JSON object containing the generated password:

{
  "password": "Ex@mpleP@ssw0rd!123",
  "length": 16,
  "strength": "strong"
}

Using Python SDK

First, install the Python SDK:

pip install passwordinator

Then, use the following Python code to generate a password:

import os
from passwordinator import Passwordinator

# It's recommended to load your API key from environment variables
api_key = os.environ.get("PASSWORDINATOR_API_KEY")

if not api_key:
    raise ValueError("PASSWORDINATOR_API_KEY environment variable not set.")

passwordinator = Passwordinator(api_key=api_key)

try:
    response = passwordinator.generate_password()
    print(f"Generated Password: {response.password}")
    print(f"Length: {response.length}")
    print(f"Strength: {response.strength}")
except Exception as e:
    print(f"An error occurred: {e}")

Using Node.js SDK

First, install the Node.js SDK:

npm install @passwordinator/node

Then, use the following Node.js code to generate a password:

const { Passwordinator } = require('@passwordinator/node');

// It's recommended to load your API key from environment variables
const apiKey = process.env.PASSWORDINATOR_API_KEY;

if (!apiKey) {
  throw new Error('PASSWORDINATOR_API_KEY environment variable not set.');
}

const passwordinator = new Passwordinator(apiKey);

async function generateAndPrintPassword() {
  try {
    const response = await passwordinator.generatePassword();
    console.log(`Generated Password: ${response.password}`);
    console.log(`Length: ${response.length}`);
    console.log(`Strength: ${response.strength}`);
  } catch (error) {
    console.error(`An error occurred: ${error.message}`);
  }
}

generateAndPrintPassword();

Common next steps

After successfully making your first request, consider these common next steps to further integrate and optimize your use of Passwordinator:

  • Explore API Parameters: The Password Generation API offers various parameters to customize password length, inclusion of special characters, numbers, and uppercase/lowercase letters. Experiment with these to meet specific security policies.
  • Implement Password Strength Checking: Utilize the Password Strength Checker API to evaluate user-provided passwords against common weaknesses, providing real-time feedback during registration or password changes.
  • Integrate Breached Password Checking: Implement the Breached Password Checker API to determine if a password has appeared in known data breaches. This helps prevent users from using compromised credentials, enhancing overall application security. For more on the importance of checking for breached credentials, refer to FIDO Alliance recommendations on strong authentication.
  • Error Handling: Implement robust error handling in your application to gracefully manage API rate limits, invalid API keys, or other potential issues. Consult the Passwordinator error code documentation.
  • Review SDK Features: If using an SDK, review its full capabilities. SDKs often provide helper functions for common tasks beyond basic API calls, simplifying integration.
  • Monitor Usage: Regularly check your Passwordinator dashboard to monitor API usage and ensure you remain within your plan's request limits.
  • Update API Key Security: Reiterate the importance of securing your API key. Consider using a dedicated secrets management service or environment variables in production environments.

Troubleshooting the first call

Encountering issues during your initial API call is common. Here are some troubleshooting steps:

  • Check API Key: Ensure your API key is correctly copied from the Passwordinator dashboard and included in the request. A common mistake is an incorrect key or a missing Bearer prefix in the Authorization header.
  • Verify Endpoint URL: Confirm that the API endpoint URL (e.g., https://api.passwordinator.com/generate) is correct and matches the API reference documentation.
  • Review Request Headers: Ensure all required headers, especially Authorization, are present and correctly formatted.
  • Examine Response Body: If you receive an error, the API response body often contains a detailed error message. For example, a 401 Unauthorized error typically indicates an issue with the API key, while a 400 Bad Request might suggest incorrect parameters. Refer to the Passwordinator error codes for specific meanings.
  • Check Rate Limits: If you are making many requests in a short period, you might hit rate limits. The API will respond with a 429 Too Many Requests status code. Implement retries with exponential backoff if this occurs.
  • Network Connectivity: Verify your machine has an active internet connection and no firewall rules are blocking outbound requests to api.passwordinator.com.
  • SDK Specific Issues: If using an SDK, ensure it is correctly installed and imported. Consult the SDK documentation for language-specific requirements and common issues.
  • Consult Documentation: The official Passwordinator documentation is the authoritative source for troubleshooting and detailed API specifications.