Apifox Documentation
website·Indexed 36 days ago
https://docs.apifox.com/Comprehensive guides and troubleshooting for Apifox, an API tool for design, debugging, and automation. Includes documentation on OpenAPI Spec exports, Socket.IO debugging, self-hosted runners, team roles and permissions, and resolving common network errors such as ECONNRESET, ETIMEDOUT, and DNS resolution issues.
What's inside Apifox
- Apifox is an all-in-one platform that integrates API design, development, debugging, management, documentation, mocking, and automated testing. It centers the entire workflow around a single API definition, ensuring that all team roles (designers, frontend developers, testers, and maintainers) work from a single, real-time updated source of truth to prevent data inconsistency and synchronization issues.
Overview of data passing mechanisms in Apifox
In Apifox automated test flows, data generated by upstream steps (API requests, database queries, loops, scripts) can be passed to downstream steps using two mechanisms:
- Dynamic Value Reference (Immediate Use): Directly read data from a previous step's output in a downstream step without storing it first.
- Variable Transfer (Store then Use): Extract specific data from an upstream step into a variable, which can then be referenced by downstream steps using the
{{variable_name}}syntax.
Overview of Apifox Scripting Capabilities
Apifox includes a built-in JavaScript scripting engine that allows developers to add dynamic operations to API requests and automated tests. Key capabilities include:
- Validating API response results using post-scripts.
- Dynamically modifying request parameters (e.g., adding signature parameters) using pre-scripts.
- Passing data between different interfaces by manipulating variables.
- Calling external programs written in Java (.jar), Python, PHP, JS, BeanShell, Go, Shell, Ruby, and Lua.
Overview of Apifox MCP Client
Apifox (version ≥2.8.3) acts as an MCP (Model Context Protocol) client, allowing developers to debug and test MCP servers. It supports the three core MCP features: Tools (executable functions), Resources (data sources), and Prompts (predefined templates). It supports two transport protocols: STDIO (for local processes via standard input/output) and HTTP (for remote servers via Streamable HTTP).Overview of Apifox Helper for IntelliJ IDEA
Apifox Helper is a plugin for IntelliJ IDEA (version 2019.3 and higher) that identifies Java and Kotlin backend source code to automatically generate API documentation and sync it to Apifox projects. It is designed for zero-intrusion, meaning it works out-of-the-box for common frameworks by recognizing standard annotations.Overview of Apifox Capabilities
Apifox is an integrated API platform that provides a comprehensive suite of tools for the entire API lifecycle, including:
- API Design: Visual OAS (OpenAPI Specification) design using JSON Schema and data models.
- API Debugging: Sending HTTP, gRPC, Dubbo, GraphQL, and WebSocket requests with automatic response validation and pre/post-processors.
- API Testing: Creating test scenarios with visual orchestration, conditional branching, loops, scheduled tasks, and performance testing.
- Mocking: Providing smart, cloud-based, and custom mock data to enable frontend development before backend completion.
- Documentation: One-click sharing and publishing of API documentation sites with customizable layouts.
- Collaboration: Iteration branches for team collaboration (branching, testing, and merging) and comprehensive project/member permission management.
- Automation: Apifox CLI for local execution, CI/CD integration, and AI Agent workflows.
Overview of Apifox CLI
Apifox CLI is a command-line tool that allows AI Agents (such as Cursor, Claude Code, Trae, and Codex) and CI/CD pipelines to programmatically access Apifox features. It provides parity with the Apifox desktop/web application, enabling users to read/write API documentation, execute scenario test cases, and import/export API documents via the terminal.Overview of AI Agent Debugger
The AI Agent Debugger is a visual debugging tool for AI Agent developers. Unlike standard input/output debugging, it tracks the entire execution process, including conversation rounds, model calls, MCP tool invocations, and custom Skill executions. It is primarily used for:
- Debugging tool call chains and troubleshooting parameter/execution errors.
- Comparing different models based on response time, Token consumption, and cost.
- Validating MCP Server integrations.
- Iterating and optimizing system prompts.
Overview of the pm object in Apifox scripts
Apifox is compatible with the Postman Script API. Thepmobject is the core object available in both Pre-request scripts and Post-request scripts. It provides access to request and response information, variable management, and the ability to send asynchronous HTTP requests.Overview of Apifox Helper for IntelliJ IDEA
Apifox Helper is a plugin for IntelliJ IDEA (version 2019.3 and higher) that identifies local Java and Kotlin backend source code to automatically generate API documentation and sync it to Apifox projects. It is designed for zero-intrusion, meaning it works out-of-the-box for common frameworks by recognizing standard annotations.Overview of API testing types supported by Apifox
Apifox supports several types of API testing to ensure reliability across the software development lifecycle:
- Integration Testing: Verifies collaboration between multiple modules or external systems and microservice interactions.
- End-to-End (E2E) Testing: Simulates real user operation paths to evaluate the availability of complete business processes.
- Regression Testing: Quickly verifies existing business logic after functional iterations to prevent regressions.
- Performance Testing: Evaluates API behavior under high load, analyzing response times and resource consumption.
- Contract Testing: Validates whether the actual API response conforms to the OpenAPI specification.
Overview of Apifox OpenAPI (Swagger) Extensions
Apifox OpenAPI (Swagger) Extensions are custom attributes added to the standard OpenAPI specification to enhance API documentation and project management. These extensions provide additional functionality and organization within Apifox without affecting the actual runtime behavior or functionality of the API.