Importing an API Source
Import an OpenAPI spec to create an API Source
To create an API store, you need to first connect your APIs to API.market.
When a user calls API.market, then API.market will call your APIs using the defined API Source and the configuration.
π― Overview
The API Source is the OpenAPI specification that connects your APIs to API.market. API.market acts as an API gateway, making your API available through a unified platform.
π‘ How it works: API.market proxies requests to your API using the OpenAPI specification. This allows API.market to handle authentication, billing, analytics, and rate limiting automatically.
π Prerequisites
Before you begin, you'll need:
β An OpenAPI specification file (YAML or JSON) β Your API's base URL β Authentication details (if required)
β οΈ Don't have an OpenAPI spec yet? You can create one using ChatGPT. Follow our guide: Create OpenAPI spec using ChatGPT
π Step-by-Step Guide
1. Click on "OpenAPI Specs" on the left side menu under "Manage APIs".
Navigate to the Seller Console and select your organization from the dropdown. Then click on "Manage APIs" in the left sidebar and select "OpenAPI Specs" .

2. Click on the "Import API Source" button.
This wizard will pop up:

Click "Continue" to proceed after selecting "Yes, I have an OpenAPI schema".
π‘ For now, we only support creating an API Source using an OpenAPI schema.
Need help? Check out this example OpenAPI schema.
3. Import the OpenAPI YAML or JSON file.
Upload or drag and drop your OpenAPI specification file. You should be able to see the paths imported from the YAML file.

Step 4: Configure Custom Headers
After importing your OpenAPI file, proceed to Step 3: Configure API Headers. Here you can add custom headers that will be included in every API request to your backend.
Enter a JSON object in the text area
Format:
{"Header-Name": "header-value"}Example:
Note: If you don't need custom headers, you can leave this as {} (empty JSON object) and proceed.

Step 5: Configure Base Path URL
Click "Continue" to proceed , here you'll set the base URL for all API requests.
The Base URL field may be pre-filled if detected from your OpenAPI spec's
serverssectionReview or enter your API's base URL
Format:
https://api.example.com/v1This URL will be used as the base for all API requests
Example:

Step 6: Configure Authentication
Click "Continue" to proceed . Here you'll choose how your API authenticates requests. This is the endpoint API.market backend will call.
You have five authentication options:
Option 1: No Authentication
Select the "None" tab
No authentication will be used when making API requests
Use this if your API doesn't require authentication

Option 2: API Key Authentication
Select the "API Key" tab
Enter the Header Name (e.g.,
X-API-Key,Authorization)Enter the API Key Value (this will be masked for security)
The API key will be sent in the specified header with each request
Example:
Header Name:
X-API-KeyAPI Key Value:
your-secret-api-key

Option 3: Bearer Token Authentication
Select the "Bearer Token" tab
Enter your bearer token (this will be masked for security)
The token will be sent in the
Authorizationheader asBearer <token>
Example:
Token:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Option 4: Basic Authentication
Select the "Basic Auth" tab
Enter your Username
Enter your Password (this will be masked for security)
Credentials will be base64 encoded and sent in the
Authorizationheader
Example:
Username:
myuserPassword:
mypassword

Option 5: Query Parameter Authentication
Select the "Query Param" tab
Enter the Parameter Key (e.g.,
api_key,token)Enter the Parameter Value (this will be masked for security)
The parameter will be added to the query string of each request
Example:
Param Key:
api_keyParam Value:
your-api-key-value

Step 7: Review Summary and Create
Click "Continue" to proceed .Here you'll review all your configuration before creating the API Source.
The summary will show:
API Source Name - The detected or entered name
API Version - The detected version
Base URL - The configured base URL
Custom Headers - The JSON object of custom headers
Authentication - The selected authentication method and configuration
Endpoints - List of all detected endpoints

Review checklist:
β API Name and Version are correct
β Base URL is correct
β Custom Headers are properly formatted
β Authentication is configured correctly
β All expected endpoints are listed
Review the summary carefully to ensure all details are correct
Click "Create API Source" or "Finish" button
Your API Source will be created and you'll be redirected to the API Sources list
You should see your new API Source in the list
Success! Your API Source is now ready to be used when creating products.
What's Next?
After importing your API Source, you can:
Create Products - Use your API Source to create API products
Configure Pricing Plans - Set up pricing for your API endpoints
Test Your APIs - Use the API Playground to test your endpoints
View Analytics - Monitor usage and performance
Troubleshooting
Common Issues
Issue: "No endpoints found"
Solution: Check that your OpenAPI spec has a
pathsobject with at least one endpoint defined
Issue: "Invalid JSON/YAML"
Solution: Validate your OpenAPI spec using an online validator like Swagger Editor
Issue: "Base URL not detected"
Solution: Make sure your OpenAPI spec includes a
serversarray with at least one server URL, or manually enter it in Step 6
Issue: "Authentication not working"
Solution:
Verify your authentication credentials are correct
Check that the header name matches what your API expects
Ensure the authentication type matches your API's requirements
Best Practices
Validate Your OpenAPI Spec - Use tools like Swagger Editor to validate your spec before importing
Test Authentication - After creating your API Source, test it with a sample request to ensure authentication works
Use Descriptive Names - Choose clear API Source names that help you identify them later
Document Custom Headers - Keep track of what custom headers you're using and why
Version Your APIs - Use semantic versioning in your API version field (e.g.,
1.0.0,2.1.3)
Last updated