Summarize this article:

They are saltwater shore-dwellers, and they need high temperatures to survive. Sand crabs live in rhythm with the tides, and it can be difficult to replicate the delicate littoral ecosystem in which they thrive. Furthermore, sand crabs feed on such a diverse diet that you may have a hard time giving them the variety they're used to. In the wild, sand crabs bury themselves deep in wet sand and catch plankton with their antennae. Replicate this process by filling your crab's habitat with beach sand, then pouring seawater over the sand a few times each day. Use any glass aquarium. Bear in mind that sand crabs cannot dig in sand that is too dry or densely-packed.  Try to bring the beach sand directly from the ecosystem where you got the crab. Local beach sand is more likely to contain the insects and microorganisms that your crab needs. Sand crabs naturally gather in shoals, so it should be okay to put several sand crabs in the same tank. Remember, however, that large crabs like to eat smaller crabs. Homemade saltwater will not do; it needs to contain algae and plankton. You can buy plankton, algae, and aquarium-grade seawater at some aquarium-supply and exotic pet stores. Be warned that these supplies can be expensive. Understand that this tactic is a short-term experiment to study the behavior of a sand crab. It is not necessarily a sustainable, long-term way to keep a sand crab as a pet. If you only need to study the sand crab for a short time, consider returning it to the wild when you're done. Sand crabs are difficult—sometimes nearly impossible—to keep as pets. If you are looking for a crab that's easy to raise and feed, consider getting a hermit crab. Do your research, create a habitat, and learn to care for hermit crabs. Aquarium hermit crabs thrive on practically any food, from algae and leftover fish food to beef, eggs, and vegetables. In the wild, hermit crabs have been known to eat leaves, fruit, and even wood. You can also buy commercial hermit crab food that mimics the crab's natural diet.
Consider the challenges of removing sand crabs from the wild. Set up a tank with fresh beach sand and seawater. Regularly refill the tank with seawater. Consider getting a hermit crab instead.