> For the complete documentation index, see [llms.txt](https://docs.crowdswap.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.crowdswap.org/developers/overview.md).

# Overview

### Introduction

CrowdSwap provides dozens of APIs that help DeFi apps to be more tangible for end users.

* Finding the best route and dex for swapping is one of these APIs. We've been trying to create and update a list of the most profitable dexes and offer them to our users.
* Cross-chain swap is another service that let users to swap their assets between different chains. Similar to swap, we tried to provide an API that simplifies the process of swapping in a way that end users do not need to worry about cross-chain steps.

Before explaining more about the details of the API, here is the link of endpoints in the swagger format: [Swagger UI](/developers/api.md)

### API Key

In order to use CrowdSwap's API, you should send a request via this link: [Request API Key](https://docs.google.com/forms/d/e/1FAIpQLScnLpbly_9_4FoiOmS4VHFpWFQzQXSLZa-Eenb-wl15-mehJg/viewform?usp=sf_link)

### Connect wallet

You can connect your dApp to a wallet like this:

```
npm install web3

npm install --save web3modal
```

This code is for Angular:

```javascript
import { Injectable } from '@angular/core';
import Web3 from "web3";
import Web3Modal from "web3modal";
import WalletConnectProvider from "@walletconnect/web3-provider";
import { Subject } from 'rxjs';

@Injectable({
  providedIn: 'root'
})
export class ContractService {
  private web3js: any;
  private provider: any;
  private accounts: any;
  web3Modal

  private accountStatusSource = new Subject<any>();
  accountStatus$ = this.accountStatusSource.asObservable();

  constructor() {
    const providerOptions = {
      walletconnect: {
        package: WalletConnectProvider, // required
        options: {
          infuraId: "INFURA_ID" // required
        }
      }
    };

    this.web3Modal = new Web3Modal({
      network: "mainnet", // optional
      cacheProvider: true, // optional
      providerOptions, // required
    });
  }

  async connectAccount() {
    this.web3Modal.clearCachedProvider();

    this.provider = await this.web3Modal.connect(); // set provider
    this.web3js = new Web3(this.provider); // create web3 instance
    this.accounts = await this.web3js.eth.getAccounts();
    this.accountStatusSource.next(this.accounts)
  }

}
```

Then you can see a modal like this:

![](/files/FKE1rQ65XoWWDAz7hPMn)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.crowdswap.org/developers/overview.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
