API Integration
Learn how to integrate Hum into your application using our API
Building with the Hum API
The Hum API provides a comprehensive set of endpoints for discovering available internet service providers, plans, and pricing at any address in the United States.
Example Integration Path
The integration process follows these key steps:
- Create a session with the service address
- Poll the session status until both geocoding and internet agents are matched
- Retrieve available internet plans for the address
- Display plans to your users
Below is a detailed walkthrough of the integration process:
-
Get Your API Key Contact your Hum representative to receive your API key. This key is required to authenticate your requests to the Hum API.
-
Create a Session Start by creating a new session with the service address:
Example response:
-
Monitor Session Status Use the session token from the response to check the status of your request:
Example response:
-
Awaiting Agent Responses The API will return available ISPs and their plans for the provided address as the session completes processing. The response includes an
agent_status
in the meta field that shows the progress of different processing steps:Agent status values:
geocoding
:pending
: Address validation in progressmatched
: Single address match foundmultiple
: Multiple possible matches foundfailed
: Unable to validate address
internet
:pending
: Provider search in progressmatched
: Providers foundfailed
: No providers found
checkout
:pending
: Ready for checkout process
Continue polling the session status endpoint every few seconds until both the geocoding and internet agents show “matched” status. The
geocoding
agent typically completes first, validating and normalizing the address. Theinternet
agent then processes available providers and plans. Once both agents show “matched”, the response will include the complete data for the address. -
Display Available Internet Plans Once both agents show “matched” status, you can retrieve the available internet plans for the address. The response will include detailed information about each provider and their available plans, including:
- Provider name and details
- Available plans with speeds and pricing
- Installation options and fees
- Contract terms and conditions
Example response:
Authentication
All API requests require authentication using your API key. Include it in the Authorization header:
Error Handling
The API uses standard HTTP status codes and returns detailed error messages in the response body. All error responses follow this format:
Common error scenarios include:
400 Bad Request
- Missing required fields (street1, city, state, zip)
- Invalid address format
- Invalid state code
- Invalid ZIP code format
401 Unauthorized
- Missing or invalid API key
- Expired API key
- Invalid authentication header format
404 Not Found
- Invalid session token
- Session not found
- Resource not found
406 Not Acceptable
- Invalid content type
- Missing content type header
410 Gone
- Session has been closed
- Session has expired
422 Unprocessable Entity
- Address validation failed
- Invalid parameter values
- Business rule violations
429 Too Many Requests
- Rate limit exceeded
- Too many concurrent sessions
500 Internal Server Error
- Server-side processing error
- Provider system unavailable
- Unexpected system error
For detailed error codes and handling, refer to the API Reference documentation.
Best Practices
-
Address Validation: While Hum validates and geocodes addresses to the Census block level, providing accurate address data upfront ensures the best results. Include complete address details including street number, street name, city, state, and ZIP code.
-
Error Handling: Implement robust error handling for common scenarios like invalid addresses, no service availability, or API rate limits. Use the error messages and status codes to provide clear feedback to your users.
-
Session Management: Store and manage session tokens appropriately. Each session represents a unique address lookup, and tokens are required for all subsequent API calls.
-
Data Caching: Consider caching provider data for frequently requested addresses to improve response times and reduce API calls.
Next Steps
- Review our API Reference for detailed endpoint documentation
Was this page helpful?