questionFAQ

Getting Started

chevron-rightHow to test the Anvil API?hashtag

To get started with the Anvil API:

  1. Get Your API Keys: Visit our self-serve portal at ada-anvil.io/api-keysarrow-up-right to generate your keys instantly. If the portal is unavailable, please email us at [email protected].

    • A Preprod key for development and testing

    • A Mainnet key with lower rate limits for basic production use

  2. Make Your First API Call: Include your API key in the X-Api-Key header:

    curl -X GET \
        -H "Content-Type: application/json" \
        -H "X-Api-Key: YOUR_API_KEY_HERE" \
        https://preprod.api.ada-anvil.app/v2/services/health
  3. Explore the Documentation: See our Build Your First Transaction guide or Cardano Basics if you're new to Cardano.

For more details about authentication, see our Authentication documentation.

chevron-rightWhat do I need to test on different Cardano environments?hashtag

You need two types of API keys: one for testnet environments and one for mainnet, along with the correct endpoint for each network.

The correct endpoints are:

  • Preprod: https://preprod.api.ada-anvil.app/v2/services

  • Preview: https://preview.api.ada-anvil.app/v2/services

  • Mainnet: https://prod.api.ada-anvil.app/v2/services

chevron-rightIs there a difference between testnet and pre-prod, or are they the same thing?hashtag

They are related but distinct:

  • Testnet refers to any non-production Cardano network. Your testnet API key works across all testnet environments (both Preprod and Preview).

  • Preprod is a specific testnet environment that closely mirrors mainnet's parameters.

  • Preview is another testnet environment focused on testing future protocol changes.

Both Preprod and Preview use test ADA (not real value), but they may be running different protocol versions. For most testing purposes, Preprod is recommended.

chevron-rightIs my tech compatible with the API?hashtag

The Anvil API is designed for maximum flexibility and compatibility across technology stacks:

  • Language Agnostic: Works with any programming language that can make HTTP requests (JavaScript, Python, Ruby, Go, Java, etc.)

  • Multiple Interface Options: Supports both REST API and tRPC for type-safe operations

  • Standard JSON Format: Uses standard JSON for request and response bodies

  • Simple Authentication: Uses straightforward API key authentication via HTTP headers

This means you can easily integrate the Anvil API with:

  • Web applications (React, Vue, Angular, etc.)

  • Mobile apps (React Native, Flutter, native iOS/Android)

  • Backend servers (Node.js, Python, PHP, Ruby, Java, Rust, Go, C#, etc.)

  • Command-line tools and scripts

Transaction Building

chevron-rightCan I build and send Cardano transactions entirely from the client-side (browser)?hashtag

Yes, but with important security considerations:

  • Never expose your API key in client-side code - API keys should always be kept on your server side

  • Be aware of transaction privacy - Direct client-side communication can expose transaction details to network observers or browser extensions

The recommended approach is a hybrid architecture:

  1. Frontend (Browser): Use Weldarrow-up-right to connect wallets and handle transaction signing

  2. Backend (Your Server): Create a secure backend service that:

    • Holds your Anvil API key securely

    • Communicates with Anvil API to build transactions

    • Sends the transaction CBOR to your frontend for signing

    • Receives the signature and submits the completed transaction

This architecture ensures your API key remains secure while still leveraging client-side wallet capabilities.

For testing purposes only, you can use the browser console to interact directly with a wallet:

chevron-rightHow do I sign a transaction to send ADA or NFTs?hashtag

For signing transactions:

  1. Browser/Frontend: Use Weld to connect to the user's wallet and request signatures

For detailed backend signing examples in multiple languages, see our comprehensive Sign Transaction guidearrow-up-right.

chevron-rightDo I need to provide UTXOs when building transactions?hashtag

Yes, you need to provide UTXOs when building transactions.

  • For Testing ONLY (Preprod/Preview): You can optionally let Anvil handle UTXO selection automatically.

  • For Production (Mainnet): You must explicitly provide UTXOs

See Selecting UTXOs for Transactions for more details.

Development Workflow

chevron-rightHow do I handle wallet integration in my application?hashtag

We strongly recommend using Weldarrow-up-right for wallet integration. It provides:

  • A unified API for multiple Cardano wallets (Eternl, Lace, Flint, etc.)

  • Simple hooks for React applications

  • Comprehensive wallet state management

  • Utilities for common wallet operations

Check our Transaction Overview for a complete flow using Weld and Anvil API.

Smart Contracts and Plutus Scripts

chevron-rightDoes the API support smart contract interaction and Plutus scripts?hashtag

Yes, Anvil API fully supports Plutus smart contract interactions:

  1. Blueprint Management (CIP-57): Upload your compiled Plutus scripts as blueprints:

  2. Script Interactions: Once uploaded, you can interact with the contract in transactions by referencing the blueprint and providing required datum/redeemer data.

See our guides on Blueprint Management and example smart contracts like our Simple Mint Smart Contract for practical demonstrations.

API Technical Details

chevron-rightAre there rate limits or usage quotas?hashtag

Yes, every API key comes with defined usage limits that protect both you and the service:

  • Daily Request Limits: Maximum number of requests per 24-hour period, 300k requests per day per key

  • Requests Per Second (RPS): Maximum throughput rate, 100 requests per second per key

These limits provide important security and stability benefits:

  1. Preventing Unauthorized Use: If your API key is compromised, rate limits minimize potential abuse by capping usage

  2. Cost Control: Helps avoid unexpected charges by setting clear boundaries on API consumption

  3. Service Reliability: Ensures no single client can overload the infrastructure, maintaining high availability for everyone

  4. Attack Mitigation: Protects against DDoS and brute force attacks by throttling excessive requests

If you exceed these limits, the API will respond with Throttled, please try again later.. Your exact quotas are configured when your API key is issued and can be tailored to your application's specific needs.

For higher limits, please contact [email protected].

chevron-rightHow is the transaction builder versioned?hashtag

The Anvil API transaction builder uses request payload versioning to maintain backward compatibility:

Endpoints that support versioning accept a version field in the request body. This allows endpoints to evolve their functionality while maintaining backward compatibility with existing integrations.

chevron-rightHow does Anvil handle blockchain upgrades and protocol changes?hashtag

Anvil's infrastructure is updated automatically to support every Cardano protocol upgrade (hard forks, new ledger rules, Plutus enhancements) with zero downtime. You don't need to change your integration—your existing endpoints continue working as the underlying node software is upgraded behind the scenes.

For testing upcoming features, you can point to the Preview endpoints, which run the latest protocol version before it hits Mainnet, so you can verify compatibility in advance.

chevron-rightHow do I query blockchain data like transaction history or UTXOs?hashtag

The Anvil API focuses primarily on transaction building and submission rather than data querying.

  • UTXO Management: In test environments, automatic UTXO selection is available

  • Production Requirements: For mainnet, you must explicitly provide UTXOs

  • Data Querying: For blockchain exploration (transaction history, balances), we recommend using dedicated blockchain explorers or data APIs like BlockFrost

Note: While not part of our standard API, we do provide specialized blockchain querying and indexing services for enterprise customers. If you need comprehensive blockchain data access for your application, please contact [email protected] to discuss your requirements.

See Selecting UTXOs for Transactions for more information about working with UTXOs in Anvil API.

Support and Feedback

chevron-rightI need help, I have a question or feedbackhashtag

Send an email to: [email protected]

Join the conversation in Discourse: (coming soon)

Last updated

Was this helpful?