API Key Management
Create and manage your API keys to access IPConfig's various API services
API Key Management
API keys are essential credentials for accessing IPConfig API services. With API keys, you can integrate our IP location query, ping test, and other services into your applications.
Getting API Keys
1. Login to Console
First, log in to your IPConfig account and access the console.
2. Create API Key
In the console, navigate to the "API Keys" page and click the "Create New Key" button.
3. Configure Key Information
- Key Name: Set a recognizable name for your API key
4. Save Key
After creation, immediately copy and securely store your API key. For security reasons, the key will only be displayed once.
Using API Keys
Authentication Method
In all API requests, you need to include your API key in the request headers:
Authorization: Bearer YOUR_API_KEY
Supported API Services
Using API keys, you can access the following services:
IP Location Query API
- Endpoint:
POST https://ipconfig.com/api/ip-query
- Function: Query detailed geographic location information for any IP address
- Cost: 1 credit per query
- Documentation: IP Location Query API
Ping Test API
- Endpoint:
POST https://ipconfig.com/api/ping
- Function: Test network connectivity and latency from multiple global nodes
- Cost: 1 credit per test node
- Documentation: Ping Test API
Get My IP API
- Endpoint:
GET https://ipconfig.com/api/get-my-ip
- Function: Get the current request's public IP address
- Cost: Free to use, no credits consumed
- Documentation: Get My IP API
Usage Examples
# Set your API key
export IPCONFIG_API_KEY='your-api-key-here'
# IP location query
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer $IPCONFIG_API_KEY" \
-X POST "https://ipconfig.com/api/ip-query" \
-d '{"ip": "8.8.8.8", "lang": "en"}'
# Ping test
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer $IPCONFIG_API_KEY" \
-X POST "https://ipconfig.com/api/ping" \
-d '{"host": "google.com", "areas": ["beijing", "tokyo"], "count": 4}'
Key Management
View Key List
On the API Keys page, you can view all created keys, including:
- Key name
- Creation time
- Last used time
- Usage statistics
- Status (enabled/disabled)
Delete Key
API keys that are no longer needed can be permanently deleted. Deletion is irreversible, so please proceed with caution.
Security Best Practices
1. Key Protection
- Store API keys in environment variables, don't hardcode them in your code
- Don't commit API keys to public code repositories
- Regularly rotate API keys
2. Permission Control
- Create different API keys for different applications
3. Usage Monitoring
- Regularly check API key usage
- Monitor unusual usage patterns
- Promptly disable suspicious keys
Credit Consumption
Different API services consume different amounts of credits:
API Service | Credit Cost |
---|---|
Get My IP | Free |
IP Location Query | 1 credit/query |
Ping Test | 1 credit/node |
You can check your current credit balance and purchase more credits on the Credit Management page.
Frequently Asked Questions
Q: What if I lose my API key?
A: For security reasons, we cannot recover lost API keys. Please create a new key and delete the old one.
Q: Are there rate limits for the API?
A: Yes, free users have a limit of 60 requests per minute, while paid users have up to 100 requests per second.
Q: How can I view API usage statistics?
A: You can view usage statistics and credit consumption records for each key on the API Keys page in the console.